summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/uvc/uvc_queue.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-04-14 04:19:51 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-30 12:11:40 -0300
commit7195f61b801104add6453e1d8a39d5c8366fc446 (patch)
tree2ff6a537e4710fc76d164dbb5765da328e8f5057 /drivers/media/usb/uvc/uvc_queue.c
parentbaf06b519051047b4ca6bcaa94ee2d85672dd443 (diff)
downloadlinux-7195f61b801104add6453e1d8a39d5c8366fc446.tar.gz
linux-7195f61b801104add6453e1d8a39d5c8366fc446.tar.bz2
linux-7195f61b801104add6453e1d8a39d5c8366fc446.zip
[media] uvcvideo: Implement DMABUF exporter role
Now that videobuf2-vmalloc supports exporting buffers, add support for the DMABUF exporter role by plugging in the videobuf2 ioctl helper. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/uvc/uvc_queue.c')
-rw-r--r--drivers/media/usb/uvc/uvc_queue.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c
index 87a19f33e460..f16b9b42689d 100644
--- a/drivers/media/usb/uvc/uvc_queue.c
+++ b/drivers/media/usb/uvc/uvc_queue.c
@@ -270,6 +270,18 @@ int uvc_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf)
return ret;
}
+int uvc_export_buffer(struct uvc_video_queue *queue,
+ struct v4l2_exportbuffer *exp)
+{
+ int ret;
+
+ mutex_lock(&queue->mutex);
+ ret = vb2_expbuf(&queue->queue, exp);
+ mutex_unlock(&queue->mutex);
+
+ return ret;
+}
+
int uvc_dequeue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf,
int nonblocking)
{