From: Michael Olbrich <m.olbrich@pengutronix.de>
To: linux-media@vger.kernel.org
Cc: kernel@pengutronix.de, Michael Olbrich <m.olbrich@pengutronix.de>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Pawel Osciak <pawel@osciak.com>
Subject: [PATCH] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev
Date: Tue, 12 Jul 2011 15:46:44 +0200 [thread overview]
Message-ID: <1310478404-9279-1-git-send-email-m.olbrich@pengutronix.de> (raw)
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>
---
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 b03d74e..effefa0 100644
--- a/drivers/media/video/mem2mem_testdev.c
+++ b/drivers/media/video/mem2mem_testdev.c
@@ -795,10 +795,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)
--
1.7.5.4
next reply other threads:[~2011-07-12 13:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-12 13:46 Michael Olbrich [this message]
2011-07-14 15:43 ` [PATCH] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev Pawel Osciak
2011-09-23 17:42 ` Robert Schwebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310478404-9279-1-git-send-email-m.olbrich@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--cc=kernel@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=pawel@osciak.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.