diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/mx2_camera.c | 6 |
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, | |||
1395 | xlate->host_fmt); | 1395 | xlate->host_fmt); |
1396 | if (pix->bytesperline < 0) | 1396 | if (pix->bytesperline < 0) |
1397 | return pix->bytesperline; | 1397 | return pix->bytesperline; |
1398 | pix->sizeimage = pix->height * pix->bytesperline; | 1398 | pix->sizeimage = soc_mbus_image_size(xlate->host_fmt, |
1399 | pix->bytesperline, pix->height); | ||
1399 | /* Check against the CSIRXCNT limit */ | 1400 | /* Check against the CSIRXCNT limit */ |
1400 | if (pix->sizeimage > 4 * 0x3ffff) { | 1401 | if (pix->sizeimage > 4 * 0x3ffff) { |
1401 | /* Adjust geometry, preserve aspect ratio */ | 1402 | /* Adjust geometry, preserve aspect ratio */ |
@@ -1406,7 +1407,8 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd, | |||
1406 | pix->bytesperline = soc_mbus_bytes_per_line(pix->width, | 1407 | pix->bytesperline = soc_mbus_bytes_per_line(pix->width, |
1407 | xlate->host_fmt); | 1408 | xlate->host_fmt); |
1408 | BUG_ON(pix->bytesperline < 0); | 1409 | BUG_ON(pix->bytesperline < 0); |
1409 | pix->sizeimage = pix->height * pix->bytesperline; | 1410 | pix->sizeimage = soc_mbus_image_size(xlate->host_fmt, |
1411 | pix->bytesperline, pix->height); | ||
1410 | } | 1412 | } |
1411 | } | 1413 | } |
1412 | 1414 | ||