diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-06-14 09:37:43 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-11-25 14:12:12 -0500 |
commit | 3e0c2f2046665bf580273b69ab18d9c76a550e34 (patch) | |
tree | 9d47682a1c7ab8ea7afef9d6282361906ed23da5 /include/media | |
parent | e15dab752d4c588544ccabdbe020a7cc092e23c8 (diff) |
[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; | |||
56 | * dmabuf | 56 | * dmabuf |
57 | * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified | 57 | * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified |
58 | * that this driver is done using the dmabuf for now | 58 | * that this driver is done using the dmabuf for now |
59 | * @prepare: called every time the buffer is passed from userspace to the | ||
60 | * driver, useful for cache synchronisation, optional | ||
61 | * @finish: called every time the buffer is passed back from the driver | ||
62 | * to the userspace, also optional | ||
59 | * @vaddr: return a kernel virtual address to a given memory buffer | 63 | * @vaddr: return a kernel virtual address to a given memory buffer |
60 | * associated with the passed private structure or NULL if no | 64 | * associated with the passed private structure or NULL if no |
61 | * such mapping exists | 65 | * such mapping exists |
@@ -82,6 +86,9 @@ struct vb2_mem_ops { | |||
82 | unsigned long size, int write); | 86 | unsigned long size, int write); |
83 | void (*put_userptr)(void *buf_priv); | 87 | void (*put_userptr)(void *buf_priv); |
84 | 88 | ||
89 | void (*prepare)(void *buf_priv); | ||
90 | void (*finish)(void *buf_priv); | ||
91 | |||
85 | void *(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf, | 92 | void *(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf, |
86 | unsigned long size, int write); | 93 | unsigned long size, int write); |
87 | void (*detach_dmabuf)(void *buf_priv); | 94 | void (*detach_dmabuf)(void *buf_priv); |