[media] soc-camera: Fix bytes per line computation for planar formats
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 21 Mar 2012 11:03:24 +0000 (08:03 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 15 May 2012 19:10:03 +0000 (16:10 -0300)
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>
drivers/media/video/soc_mediabus.c

index 44dba6c0f7909b3093a5d6dc993341a079b8d96f..a7073142f9f1acf399173e0c06c4f34f60c217b8 100644 (file)
@@ -378,6 +378,9 @@ EXPORT_SYMBOL(soc_mbus_samples_per_pixel);
 
 s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf)
 {
+       if (mf->layout != SOC_MBUS_LAYOUT_PACKED)
+               return width * mf->bits_per_sample / 8;
+
        switch (mf->packing) {
        case SOC_MBUS_PACKING_NONE:
                return width * mf->bits_per_sample / 8;