All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev
@ 2011-07-12 13:46 Michael Olbrich
  2011-07-14 15:43 ` Pawel Osciak
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2011-07-12 13:46 UTC (permalink / raw)
  To: linux-media; +Cc: kernel, Michael Olbrich, Mauro Carvalho Chehab, Pawel Osciak

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev
  2011-07-12 13:46 [PATCH] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev Michael Olbrich
@ 2011-07-14 15:43 ` Pawel Osciak
  2011-09-23 17:42   ` Robert Schwebel
  0 siblings, 1 reply; 3+ messages in thread
From: Pawel Osciak @ 2011-07-14 15:43 UTC (permalink / raw)
  To: Michael Olbrich; +Cc: linux-media, kernel, Mauro Carvalho Chehab

Acked-by: Pawel Osciak <pawel@osciak.com>

Thanks Michael!
Pawel

On Tue, Jul 12, 2011 at 06:46, Michael Olbrich <m.olbrich@pengutronix.de> wrote:
> 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
>
>



-- 
Best regards,
Pawel Osciak

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev
  2011-07-14 15:43 ` Pawel Osciak
@ 2011-09-23 17:42   ` Robert Schwebel
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Schwebel @ 2011-09-23 17:42 UTC (permalink / raw)
  To: Pawel Osciak; +Cc: Michael Olbrich, linux-media, kernel, Mauro Carvalho Chehab

Hi,

On Thu, Jul 14, 2011 at 08:43:38AM -0700, Pawel Osciak wrote:
> Acked-by: Pawel Osciak <pawel@osciak.com>

As nobody had objections to Michael's patch, can we do something to move
this forward?

Thanks,
rsc
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-23 17:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12 13:46 [PATCH] v4l: mem2mem: add wait_{prepare,finish} ops to m2m_testdev Michael Olbrich
2011-07-14 15:43 ` Pawel Osciak
2011-09-23 17:42   ` Robert Schwebel

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.