summaryrefslogtreecommitdiff
path: root/drivers/media/video/mx3_camera.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-05-20 04:25:09 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 12:05:08 -0300
commitcc552b620fa3a184ba3d4064223ca1d59325b166 (patch)
tree8de21b7b635acbc87f71f790af917f3a4c56ee20 /drivers/media/video/mx3_camera.c
parente9ceeced6feb6f072d59b87fe5a47c37e2b50d51 (diff)
[media] V4L: soc-camera: add a new packing for YUV 4:2:0 type formats
12-bit formats, similar to YUV 4:2:0 occupy 3 bytes for each two pixels and cannot be described by any of the existing SOC_MBUS_PACKING_* macros. This patch adds a new one SOC_MBUS_PACKING_1_5X8 to describe such formats and extends soc_mbus_samples_per_pixel() to support it. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mx3_camera.c')
-rw-r--r--drivers/media/video/mx3_camera.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index 8630c0c9e60..3e5435b539b 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -756,8 +756,10 @@ static void configure_geometry(struct mx3_camera_dev *mx3_cam,
* the width parameter count the number of samples to
* capture to complete the whole image width.
*/
- width *= soc_mbus_samples_per_pixel(fmt);
- BUG_ON(width < 0);
+ unsigned int num, den;
+ int ret = soc_mbus_samples_per_pixel(fmt, &num, &den);
+ BUG_ON(ret < 0);
+ width = width * num / den;
}
/* Setup frame size - this cannot be changed on-the-fly... */