summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/uvc_queue.h
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-02-17 05:44:06 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-03-02 17:05:23 -0300
commitd8e96c4bf6e3cdb6580381fdad2bfd93fae36ff1 (patch)
tree33cda874ad792de10143f65311dce360f4244260 /drivers/usb/gadget/function/uvc_queue.h
parent2e1328dd5a8fd1fa98bf8fca49c5e6df61797a99 (diff)
[media] uvc gadget: switch to v4l2 core locking
Switch this driver over to the V4L2 core locking mechanism in preparation for switching to unlocked_ioctl. Suggested by Laurent Pinchart. This patch introduces a new mutex at the struct uvc_video level and drops the old mutex at the queue level. The new lock is now used for all ioctl locking and in the release file operation (the driver always has to take care of locking in file operations, the core only serializes ioctls). Note that the mmap and get_unmapped_area file operations no longer take a lock. Commit f035eb4e976ef5a059e30bc91cfd310ff030a7d3 fixed a AB-BA deadlock by moving all the locking down into vb2, so the mmap and get_unmapped_area file operations should no longer do any locking before calling into vb2. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/usb/gadget/function/uvc_queue.h')
-rw-r--r--drivers/usb/gadget/function/uvc_queue.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/uvc_queue.h b/drivers/usb/gadget/function/uvc_queue.h
index 03919c724961..01ca9eab3481 100644
--- a/drivers/usb/gadget/function/uvc_queue.h
+++ b/drivers/usb/gadget/function/uvc_queue.h
@@ -41,7 +41,6 @@ struct uvc_buffer {
struct uvc_video_queue {
struct vb2_queue queue;
- struct mutex mutex; /* Protects queue */
unsigned int flags;
__u32 sequence;
@@ -57,7 +56,8 @@ static inline int uvc_queue_streaming(struct uvc_video_queue *queue)
return vb2_is_streaming(&queue->queue);
}
-int uvcg_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type);
+int uvcg_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type,
+ struct mutex *lock);
void uvcg_free_buffers(struct uvc_video_queue *queue);