diff options
author | Tomasz Stanislawski <t.stanislaws@samsung.com> | 2012-06-14 10:32:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-11-25 14:21:00 -0500 |
commit | 83ae7c5a1b5b5cd4380ff70797e4c5dcfb61a70d (patch) | |
tree | 2b1b4741b24b73c9a61ebe48fb9a399b194e01e0 /include/media | |
parent | 19b6ef51640fb35666884c7b577b1a24a4be8e34 (diff) |
[media] v4l: vb2: add buffer exporting via dmabuf
This patch adds extension to videobuf2-core. It allow to export an mmap buffer
as a DMABUF file descriptor.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@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/v4l2-mem2mem.h | 3 | ||||
-rw-r--r-- | include/media/videobuf2-core.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index 131cc4a53675..7e82d2b193d5 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h | |||
@@ -111,6 +111,9 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | |||
111 | int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 111 | int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
112 | struct v4l2_buffer *buf); | 112 | struct v4l2_buffer *buf); |
113 | 113 | ||
114 | int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
115 | struct v4l2_exportbuffer *eb); | ||
116 | |||
114 | int v4l2_m2m_streamon(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 117 | int v4l2_m2m_streamon(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
115 | enum v4l2_buf_type type); | 118 | enum v4l2_buf_type type); |
116 | int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 119 | int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 24b9c90194f2..9cfd4ee9e56f 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -81,6 +81,7 @@ struct vb2_fileio_data; | |||
81 | struct vb2_mem_ops { | 81 | struct vb2_mem_ops { |
82 | void *(*alloc)(void *alloc_ctx, unsigned long size); | 82 | void *(*alloc)(void *alloc_ctx, unsigned long size); |
83 | void (*put)(void *buf_priv); | 83 | void (*put)(void *buf_priv); |
84 | struct dma_buf *(*get_dmabuf)(void *buf_priv); | ||
84 | 85 | ||
85 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, | 86 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, |
86 | unsigned long size, int write); | 87 | unsigned long size, int write); |
@@ -363,6 +364,7 @@ int __must_check vb2_queue_init(struct vb2_queue *q); | |||
363 | void vb2_queue_release(struct vb2_queue *q); | 364 | void vb2_queue_release(struct vb2_queue *q); |
364 | 365 | ||
365 | int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b); | 366 | int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b); |
367 | int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb); | ||
366 | int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking); | 368 | int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking); |
367 | 369 | ||
368 | int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type); | 370 | int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type); |
@@ -472,6 +474,8 @@ int vb2_ioctl_qbuf(struct file *file, void *priv, struct v4l2_buffer *p); | |||
472 | int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p); | 474 | int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p); |
473 | int vb2_ioctl_streamon(struct file *file, void *priv, enum v4l2_buf_type i); | 475 | int vb2_ioctl_streamon(struct file *file, void *priv, enum v4l2_buf_type i); |
474 | int vb2_ioctl_streamoff(struct file *file, void *priv, enum v4l2_buf_type i); | 476 | int vb2_ioctl_streamoff(struct file *file, void *priv, enum v4l2_buf_type i); |
477 | int vb2_ioctl_expbuf(struct file *file, void *priv, | ||
478 | struct v4l2_exportbuffer *p); | ||
475 | 479 | ||
476 | /* struct v4l2_file_operations helpers */ | 480 | /* struct v4l2_file_operations helpers */ |
477 | 481 | ||