[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 <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Tested-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
Marek Szyprowski 2012-06-14 10:37:43 -03:00 • committed by Mauro Carvalho Chehab
commit 3e0c2f2046
2 changed files with 18 additions and 0 deletions

View file

@ -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);