mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
media: videobuf2-dma-sg: fix vmap callback
commit608ca5a60eupstream. For dmabuf import users to be able to use the vaddr from another videobuf2-dma-sg source, the exporter needs to set a proper vaddr on vb2_dma_sg_dmabuf_ops_vmap callback. This patch adds vmap on map if buf->vaddr was not set. Cc: stable@kernel.org Fixes:7938f42181("dma-buf-map: Rename to iosys-map") Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Acked-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7af40dfdbd
commit
72a28c9283
|
|
@ -487,9 +487,15 @@ vb2_dma_sg_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,
|
|||
static int vb2_dma_sg_dmabuf_ops_vmap(struct dma_buf *dbuf,
|
||||
struct iosys_map *map)
|
||||
{
|
||||
struct vb2_dma_sg_buf *buf = dbuf->priv;
|
||||
struct vb2_dma_sg_buf *buf;
|
||||
void *vaddr;
|
||||
|
||||
iosys_map_set_vaddr(map, buf->vaddr);
|
||||
buf = dbuf->priv;
|
||||
vaddr = vb2_dma_sg_vaddr(buf->vb, buf);
|
||||
if (!vaddr)
|
||||
return -EINVAL;
|
||||
|
||||
iosys_map_set_vaddr(map, vaddr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user