summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mx2_camera.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-03-21 12:03:27 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-15 21:11:23 +0200
commitb0a461ff1b476067c24131ea0b2a40571592f761 (patch)
tree9d52228582a240e20451cb04af866a63497414a5 /drivers/media/video/mx2_camera.c
parent[media] soc-camera: Honor user-requested bytesperline and sizeimage (diff)
downloadlinux-b0a461ff1b476067c24131ea0b2a40571592f761.tar.xz
linux-b0a461ff1b476067c24131ea0b2a40571592f761.zip
[media] mx2_camera: Use soc_mbus_image_size() instead of manual computation
Use the new soc_mbus_image_size() function to compute the image size. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mx2_camera.c')
-rw-r--r--drivers/media/video/mx2_camera.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 368049dbe105..b63168781cfe 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -1395,7 +1395,8 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
xlate->host_fmt);
if (pix->bytesperline < 0)
return pix->bytesperline;
- pix->sizeimage = pix->height * pix->bytesperline;
+ pix->sizeimage = soc_mbus_image_size(xlate->host_fmt,
+ pix->bytesperline, pix->height);
/* Check against the CSIRXCNT limit */
if (pix->sizeimage > 4 * 0x3ffff) {
/* Adjust geometry, preserve aspect ratio */
@@ -1406,7 +1407,8 @@ 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;
+ pix->sizeimage = soc_mbus_image_size(xlate->host_fmt,
+ pix->bytesperline, pix->height);
}
}