From: Laurent Pinchart Date: Wed, 21 Mar 2012 11:03:20 +0000 (-0300) Subject: [media] mx2_camera: Fix sizeimage computation in try_fmt() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=584943aa0692fea9ec3356c7d4677dd7a225cdef;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] mx2_camera: Fix sizeimage computation in try_fmt() The try_fmt() handler restricts the image width based on the hardware limits and updates the bytesperline value, but doesn't update sizeimage. Fix it. Signed-off-by: Laurent Pinchart Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index 7c3c0e8eda42..36d17f3483eb 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c @@ -1416,6 +1416,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd, pix->bytesperline = soc_mbus_bytes_per_line(pix->width, xlate->host_fmt); BUG_ON(pix->bytesperline < 0); + pix->sizeimage = pix->height * pix->bytesperline; } }