diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-21 12:03:28 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-15 21:12:54 +0200 |
commit | 914f05c8118e17d65c4626ae3ed2edcf79f00031 (patch) | |
tree | b41353c64be1394015f7c976fbafb299b61c21e8 /drivers/media/video/soc_camera.c | |
parent | [media] mx2_camera: Use soc_mbus_image_size() instead of manual computation (diff) | |
download | linux-914f05c8118e17d65c4626ae3ed2edcf79f00031.tar.xz linux-914f05c8118e17d65c4626ae3ed2edcf79f00031.zip |
[media] soc-camera: Support user-configurable line stride
Add a capabilities field to the soc_camera_host structure to flag hosts
that support user-configurable line strides. soc_camera_try_fmt() then
passes the user-provided bytesperline and sizeimage format fields to
such hosts, and expects the host to check (and fix if needed) the
values.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[g.liakhovetski@gmx.de: fix a typo in mx2_camera.c]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/soc_camera.c')
-rw-r--r-- | drivers/media/video/soc_camera.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 5e3274e55756..cfac53544ba6 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -171,8 +171,10 @@ static int soc_camera_try_fmt(struct soc_camera_device *icd, dev_dbg(icd->pdev, "TRY_FMT(%c%c%c%c, %ux%u)\n", pixfmtstr(pix->pixelformat), pix->width, pix->height); - pix->bytesperline = 0; - pix->sizeimage = 0; + if (!(ici->capabilities & SOCAM_HOST_CAP_STRIDE)) { + pix->bytesperline = 0; + pix->sizeimage = 0; + } ret = ici->ops->try_fmt(icd, f); if (ret < 0) |