aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/soc_camera.c3
-rw-r--r--drivers/media/video/soc_mediabus.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index b03ffecb7438..1bde255e45df 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -171,7 +171,8 @@ static int soc_camera_try_fmt(struct soc_camera_device *icd,
171 dev_dbg(icd->pdev, "TRY_FMT(%c%c%c%c, %ux%u)\n", 171 dev_dbg(icd->pdev, "TRY_FMT(%c%c%c%c, %ux%u)\n",
172 pixfmtstr(pix->pixelformat), pix->width, pix->height); 172 pixfmtstr(pix->pixelformat), pix->width, pix->height);
173 173
174 if (!(ici->capabilities & SOCAM_HOST_CAP_STRIDE)) { 174 if (pix->pixelformat != V4L2_PIX_FMT_JPEG &&
175 !(ici->capabilities & SOCAM_HOST_CAP_STRIDE)) {
175 pix->bytesperline = 0; 176 pix->bytesperline = 0;
176 pix->sizeimage = 0; 177 pix->sizeimage = 0;
177 } 178 }
diff --git a/drivers/media/video/soc_mediabus.c b/drivers/media/video/soc_mediabus.c
index 89dce097a827..a397812635d6 100644
--- a/drivers/media/video/soc_mediabus.c
+++ b/drivers/media/video/soc_mediabus.c
@@ -378,6 +378,9 @@ EXPORT_SYMBOL(soc_mbus_samples_per_pixel);
378 378
379s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf) 379s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf)
380{ 380{
381 if (mf->fourcc == V4L2_PIX_FMT_JPEG)
382 return 0;
383
381 if (mf->layout != SOC_MBUS_LAYOUT_PACKED) 384 if (mf->layout != SOC_MBUS_LAYOUT_PACKED)
382 return width * mf->bits_per_sample / 8; 385 return width * mf->bits_per_sample / 8;
383 386
@@ -400,6 +403,9 @@ EXPORT_SYMBOL(soc_mbus_bytes_per_line);
400s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf, 403s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf,
401 u32 bytes_per_line, u32 height) 404 u32 bytes_per_line, u32 height)
402{ 405{
406 if (mf->fourcc == V4L2_PIX_FMT_JPEG)
407 return 0;
408
403 if (mf->layout == SOC_MBUS_LAYOUT_PACKED) 409 if (mf->layout == SOC_MBUS_LAYOUT_PACKED)
404 return bytes_per_line * height; 410 return bytes_per_line * height;
405 411