aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-03-21 07:03:24 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-15 15:10:03 -0400
commit4e0e620ce713893b2883522a16a71b5589e8e3db (patch)
tree4832070df5b89a6a231bff603e9c9700b3c280f5 /drivers/media/video
parentad3b81faa1db60b2052f5f5a6ddae712f51b2dff (diff)
[media] soc-camera: Fix bytes per line computation for planar formats
The V4L2 specification defines bytesperline for planar formats as the number of bytes per line for the largest plane. Modify soc_mbus_bytes_per_line() accordingly. 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')
-rw-r--r--drivers/media/video/soc_mediabus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/soc_mediabus.c b/drivers/media/video/soc_mediabus.c
index 44dba6c0f790..a7073142f9f1 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->layout != SOC_MBUS_LAYOUT_PACKED)
382 return width * mf->bits_per_sample / 8;
383
381 switch (mf->packing) { 384 switch (mf->packing) {
382 case SOC_MBUS_PACKING_NONE: 385 case SOC_MBUS_PACKING_NONE:
383 return width * mf->bits_per_sample / 8; 386 return width * mf->bits_per_sample / 8;