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: http://git.lede-project.org./?a=commitdiff_plain;h=584943aa0692fea9ec3356c7d4677dd7a225cdef;p=openwrt%2Fstaging%2Fblogic.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; } }