]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[media] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev
authorMichael Olbrich <m.olbrich@pengutronix.de>
Tue, 12 Jul 2011 12:46:44 +0000 (09:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 26 Sep 2011 11:14:46 +0000 (08:14 -0300)
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>
drivers/media/video/mem2mem_testdev.c

index 0d0c0d5ac3a4a1b29bca4501a1ac0187bef9c1f0..9594b52f86059d533f179d350c55d322294c4a68 100644 (file)
@@ -793,10 +793,24 @@ static void m2mtest_buf_queue(struct vb2_buffer *vb)
        v4l2_m2m_buf_queue(ctx->m2m_ctx, vb);
 }
 
+static void m2mtest_wait_prepare(struct vb2_queue *q)
+{
+       struct m2mtest_ctx *ctx = vb2_get_drv_priv(q);
+       m2mtest_unlock(ctx);
+}
+
+static void m2mtest_wait_finish(struct vb2_queue *q)
+{
+       struct m2mtest_ctx *ctx = vb2_get_drv_priv(q);
+       m2mtest_lock(ctx);
+}
+
 static struct vb2_ops m2mtest_qops = {
        .queue_setup     = m2mtest_queue_setup,
        .buf_prepare     = m2mtest_buf_prepare,
        .buf_queue       = m2mtest_buf_queue,
+       .wait_prepare    = m2mtest_wait_prepare,
+       .wait_finish     = m2mtest_wait_finish,
 };
 
 static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq)