diff options
-rw-r--r-- | drivers/media/video/soc_camera.c | 9 | ||||
-rw-r--r-- | include/media/soc_camera.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index fa80a4a914d4..07525e74c4b4 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c | |||
@@ -389,6 +389,8 @@ static int soc_camera_set_fmt(struct soc_camera_device *icd, | |||
389 | 389 | ||
390 | icd->user_width = pix->width; | 390 | icd->user_width = pix->width; |
391 | icd->user_height = pix->height; | 391 | icd->user_height = pix->height; |
392 | icd->bytesperline = pix->bytesperline; | ||
393 | icd->sizeimage = pix->sizeimage; | ||
392 | icd->colorspace = pix->colorspace; | 394 | icd->colorspace = pix->colorspace; |
393 | icd->field = pix->field; | 395 | icd->field = pix->field; |
394 | if (ici->ops->init_videobuf) | 396 | if (ici->ops->init_videobuf) |
@@ -661,14 +663,11 @@ static int soc_camera_g_fmt_vid_cap(struct file *file, void *priv, | |||
661 | 663 | ||
662 | pix->width = icd->user_width; | 664 | pix->width = icd->user_width; |
663 | pix->height = icd->user_height; | 665 | pix->height = icd->user_height; |
666 | pix->bytesperline = icd->bytesperline; | ||
667 | pix->sizeimage = icd->sizeimage; | ||
664 | pix->field = icd->field; | 668 | pix->field = icd->field; |
665 | pix->pixelformat = icd->current_fmt->host_fmt->fourcc; | 669 | pix->pixelformat = icd->current_fmt->host_fmt->fourcc; |
666 | pix->bytesperline = soc_mbus_bytes_per_line(pix->width, | ||
667 | icd->current_fmt->host_fmt); | ||
668 | pix->colorspace = icd->colorspace; | 670 | pix->colorspace = icd->colorspace; |
669 | if (pix->bytesperline < 0) | ||
670 | return pix->bytesperline; | ||
671 | pix->sizeimage = pix->height * pix->bytesperline; | ||
672 | dev_dbg(&icd->dev, "current_fmt->fourcc: 0x%08x\n", | 671 | dev_dbg(&icd->dev, "current_fmt->fourcc: 0x%08x\n", |
673 | icd->current_fmt->host_fmt->fourcc); | 672 | icd->current_fmt->host_fmt->fourcc); |
674 | return 0; | 673 | return 0; |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 6e96b2657b5c..f80b5372baf3 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -30,6 +30,8 @@ struct soc_camera_device { | |||
30 | struct device *pdev; /* Platform device */ | 30 | struct device *pdev; /* Platform device */ |
31 | s32 user_width; | 31 | s32 user_width; |
32 | s32 user_height; | 32 | s32 user_height; |
33 | u32 bytesperline; /* for padding, zero if unused */ | ||
34 | u32 sizeimage; | ||
33 | enum v4l2_colorspace colorspace; | 35 | enum v4l2_colorspace colorspace; |
34 | unsigned char iface; /* Host number */ | 36 | unsigned char iface; /* Host number */ |
35 | unsigned char devnum; /* Device number per host */ | 37 | unsigned char devnum; /* Device number per host */ |