diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-07-12 08:46:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-26 07:14:46 -0400 |
commit | 0f910bf0008c54b33da5691278c8ee8e8700ac48 (patch) | |
tree | 85fbb6f38254da3daa43482d8e8708d95d12f2ae | |
parent | 0689133b7fadd2e10f4bddca36c895223a541c6c (diff) |
[media] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev
These are necessary to prevent dead-locks e.g. if one thread waits
in dqbuf at one end and another tries to queue a buffer at the
other end.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Pawel Osciak <pawel@osciak.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/mem2mem_testdev.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c index 0d0c0d5ac3a4..9594b52f8605 100644 --- a/drivers/media/video/mem2mem_testdev.c +++ b/drivers/media/video/mem2mem_testdev.c | |||
@@ -793,10 +793,24 @@ static void m2mtest_buf_queue(struct vb2_buffer *vb) | |||
793 | v4l2_m2m_buf_queue(ctx->m2m_ctx, vb); | 793 | v4l2_m2m_buf_queue(ctx->m2m_ctx, vb); |
794 | } | 794 | } |
795 | 795 | ||
796 | static void m2mtest_wait_prepare(struct vb2_queue *q) | ||
797 | { | ||
798 | struct m2mtest_ctx *ctx = vb2_get_drv_priv(q); | ||
799 | m2mtest_unlock(ctx); | ||
800 | } | ||
801 | |||
802 | static void m2mtest_wait_finish(struct vb2_queue *q) | ||
803 | { | ||
804 | struct m2mtest_ctx *ctx = vb2_get_drv_priv(q); | ||
805 | m2mtest_lock(ctx); | ||
806 | } | ||
807 | |||
796 | static struct vb2_ops m2mtest_qops = { | 808 | static struct vb2_ops m2mtest_qops = { |
797 | .queue_setup = m2mtest_queue_setup, | 809 | .queue_setup = m2mtest_queue_setup, |
798 | .buf_prepare = m2mtest_buf_prepare, | 810 | .buf_prepare = m2mtest_buf_prepare, |
799 | .buf_queue = m2mtest_buf_queue, | 811 | .buf_queue = m2mtest_buf_queue, |
812 | .wait_prepare = m2mtest_wait_prepare, | ||
813 | .wait_finish = m2mtest_wait_finish, | ||
800 | }; | 814 | }; |
801 | 815 | ||
802 | static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq) | 816 | static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq) |