From 9166e1aae3c90720fc389815909cb0bb815d9bca Mon Sep 17 00:00:00 2001 From: Katsuya Matsubara Date: Tue, 23 Apr 2013 07:51:35 -0300 Subject: [media] sh_veu: invoke v4l2_m2m_job_finish() even if a job has been aborted v4l2_m2m_job_finish() should be invoked even if the current ongoing job has been aborted since v4l2_m2m_ctx_release() which has issued the job abort may wait until the finish function is invoked. Signed-off-by: Katsuya Matsubara Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/sh_veu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/media/platform/sh_veu.c') diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index 0b32cc3f6a47..6fecf9f4a8dc 100644 --- a/drivers/media/platform/sh_veu.c +++ b/drivers/media/platform/sh_veu.c @@ -1138,10 +1138,7 @@ static irqreturn_t sh_veu_isr(int irq, void *dev_id) veu->xaction++; - if (!veu->aborting) - return IRQ_WAKE_THREAD; - - return IRQ_HANDLED; + return IRQ_WAKE_THREAD; } static int sh_veu_probe(struct platform_device *pdev) -- cgit v1.2.3 From 6abb3cf2c34554590791b7486e0e32b291feacc4 Mon Sep 17 00:00:00 2001 From: Katsuya Matsubara Date: Tue, 23 Apr 2013 07:51:36 -0300 Subject: [media] sh_veu: keep power supply until the m2m context is released In the sh_veu driver, only the interrupt handler 'sh_veu_bh' can invoke the v4l2_m2m_job_finish() function. So the hardware must be alive for handling interrupts until returning from v4l2_m2m_ctx_release(). Signed-off-by: Katsuya Matsubara Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/sh_veu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/platform/sh_veu.c') diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index 6fecf9f4a8dc..ebf90bfab5ce 100644 --- a/drivers/media/platform/sh_veu.c +++ b/drivers/media/platform/sh_veu.c @@ -1033,8 +1033,6 @@ static int sh_veu_release(struct file *file) dev_dbg(veu->dev, "Releasing instance %p\n", veu_file); - pm_runtime_put(veu->dev); - if (veu_file == veu->capture) { veu->capture = NULL; vb2_queue_release(v4l2_m2m_get_vq(veu->m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE)); @@ -1050,6 +1048,8 @@ static int sh_veu_release(struct file *file) veu->m2m_ctx = NULL; } + pm_runtime_put(veu->dev); + kfree(veu_file); return 0; -- cgit v1.2.3 From 697a6d2387692c7f9c94f3bfb3dac474aa840f02 Mon Sep 17 00:00:00 2001 From: Katsuya Matsubara Date: Tue, 23 Apr 2013 07:51:37 -0300 Subject: [media] sh_veu: fix the buffer size calculation The 'bytesperline' value only indicates the stride of the Y plane if the color format is planar, such as NV12. When calculating the total plane size, the size of CbCr plane must also be considered. Signed-off-by: Katsuya Matsubara Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/sh_veu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/media/platform/sh_veu.c') diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index ebf90bfab5ce..59a9deefb242 100644 --- a/drivers/media/platform/sh_veu.c +++ b/drivers/media/platform/sh_veu.c @@ -905,11 +905,11 @@ static int sh_veu_queue_setup(struct vb2_queue *vq, if (ftmp.fmt.pix.width != pix->width || ftmp.fmt.pix.height != pix->height) return -EINVAL; - size = pix->bytesperline ? pix->bytesperline * pix->height : - pix->width * pix->height * fmt->depth >> 3; + size = pix->bytesperline ? pix->bytesperline * pix->height * fmt->depth / fmt->ydepth : + pix->width * pix->height * fmt->depth / fmt->ydepth; } else { vfmt = sh_veu_get_vfmt(veu, vq->type); - size = vfmt->bytesperline * vfmt->frame.height; + size = vfmt->bytesperline * vfmt->frame.height * vfmt->fmt->depth / vfmt->fmt->ydepth; } if (count < 2) -- cgit v1.2.3