summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-mem2mem.c
diff options
context:
space:
mode:
authorHans Verkuil2010-09-20 22:24:30 +0200
committerMauro Carvalho Chehab2010-10-21 05:06:14 +0200
commit97397687886aa8ecd4ec603fab9e70e970c11597 (patch)
tree339d460b43d2ec7206c9d147d2ad6f8fcbfa3870 /drivers/media/video/v4l2-mem2mem.c
parentV4L/DVB: v4l2: add core serialization lock (diff)
downloadkernel-qcow2-linux-97397687886aa8ecd4ec603fab9e70e970c11597.tar.gz
kernel-qcow2-linux-97397687886aa8ecd4ec603fab9e70e970c11597.tar.xz
kernel-qcow2-linux-97397687886aa8ecd4ec603fab9e70e970c11597.zip
V4L/DVB: videobuf: prepare to make locking optional in videobuf
Currently videobuf uses the vb_lock mutex to lock its data structures. But this locking will (optionally) move into the v4l2 core, which means that in that case vb_lock shouldn't be used since the external lock is already held. Prepare for this by adding a pointer to such an external mutex and don't lock if that pointer is set. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-mem2mem.c')
-rw-r--r--drivers/media/video/v4l2-mem2mem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/v4l2-mem2mem.c b/drivers/media/video/v4l2-mem2mem.c
index f45f9405ea39..ac832a28e18e 100644
--- a/drivers/media/video/v4l2-mem2mem.c
+++ b/drivers/media/video/v4l2-mem2mem.c
@@ -421,8 +421,8 @@ unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
src_q = v4l2_m2m_get_src_vq(m2m_ctx);
dst_q = v4l2_m2m_get_dst_vq(m2m_ctx);
- mutex_lock(&src_q->vb_lock);
- mutex_lock(&dst_q->vb_lock);
+ videobuf_queue_lock(src_q);
+ videobuf_queue_lock(dst_q);
if (src_q->streaming && !list_empty(&src_q->stream))
src_vb = list_first_entry(&src_q->stream,
@@ -450,8 +450,8 @@ unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
}
end:
- mutex_unlock(&dst_q->vb_lock);
- mutex_unlock(&src_q->vb_lock);
+ videobuf_queue_unlock(dst_q);
+ videobuf_queue_unlock(src_q);
return rc;
}
EXPORT_SYMBOL_GPL(v4l2_m2m_poll);