diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-06-14 15:37:43 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-11-25 20:12:12 +0100 |
commit | 3e0c2f2046665bf580273b69ab18d9c76a550e34 (patch) | |
tree | 9d47682a1c7ab8ea7afef9d6282361906ed23da5 /include/media | |
parent | [media] v4l: vb2-dma-contig: add support for scatterlist in userptr mode (diff) | |
download | linux-3e0c2f2046665bf580273b69ab18d9c76a550e34.tar.xz linux-3e0c2f2046665bf580273b69ab18d9c76a550e34.zip |
[media] v4l: vb2: add prepare/finish callbacks to allocators
This patch adds support for prepare/finish callbacks in VB2 allocators. These
callback are used for buffer flushing.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/videobuf2-core.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 689ae4ac2572..24b9c90194f2 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -56,6 +56,10 @@ struct vb2_fileio_data; * dmabuf * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified * that this driver is done using the dmabuf for now + * @prepare: called every time the buffer is passed from userspace to the + * driver, useful for cache synchronisation, optional + * @finish: called every time the buffer is passed back from the driver + * to the userspace, also optional * @vaddr: return a kernel virtual address to a given memory buffer * associated with the passed private structure or NULL if no * such mapping exists @@ -82,6 +86,9 @@ struct vb2_mem_ops { unsigned long size, int write); void (*put_userptr)(void *buf_priv); + void (*prepare)(void *buf_priv); + void (*finish)(void *buf_priv); + void *(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf, unsigned long size, int write); void (*detach_dmabuf)(void *buf_priv); |