From 035aa1475d6e4afdf97dccf6c6d6059063398b57 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Wed, 24 Aug 2011 06:43:36 -0300 Subject: [media] media: vb2: change plane sizes array to unsigned int[] Plane sizes array was declared as unsigned long[], while unsigned int is more than enough for storing size of the video buffer. This patch reduces the size of the array by definiting it as unsigned int[]. Reported-by: Laurent Pinchart Signed-off-by: Marek Szyprowski Signed-off-by: Kyungmin Park CC: Pawel Osciak Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/mem2mem_testdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/mem2mem_testdev.c') diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c index 166bf9349c10..0d0c0d5ac3a4 100644 --- a/drivers/media/video/mem2mem_testdev.c +++ b/drivers/media/video/mem2mem_testdev.c @@ -739,7 +739,7 @@ static const struct v4l2_ioctl_ops m2mtest_ioctl_ops = { */ static int m2mtest_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, - unsigned int *nplanes, unsigned long sizes[], + unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) { struct m2mtest_ctx *ctx = vb2_get_drv_priv(vq); -- cgit v1.2.3 From 0f910bf0008c54b33da5691278c8ee8e8700ac48 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Tue, 12 Jul 2011 09:46:44 -0300 Subject: [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 Cc: Mauro Carvalho Chehab Cc: Pawel Osciak Acked-by: Pawel Osciak Signed-off-by: Marek Szyprowski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/mem2mem_testdev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drivers/media/video/mem2mem_testdev.c') 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) 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) -- cgit v1.2.3