diff options
author | Guennadi Liakhovetski <lg@denx.de> | 2008-12-18 09:53:51 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:40:22 -0500 |
commit | bf507158eb27ea94aca300b28ecee60fdbb40007 (patch) | |
tree | 0c328050cb0393e4e7c54075b5608e6a7bdc987e /drivers/media | |
parent | 64f5905ee74906643e22657bd20e2f11443053f0 (diff) |
V4L/DVB (10081): pxa-camera: call try_fmt() camera device method with correct pixel format
With the introduction of the format conversion support in soc-camera, we now
also have to take care to pass the correct pixel format to the camera driver
when calling its try_fmt() method.
Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/pxa_camera.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index f6919a0e2ac2..aa7efc45d364 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c | |||
@@ -1218,6 +1218,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd, | |||
1218 | const struct soc_camera_format_xlate *xlate; | 1218 | const struct soc_camera_format_xlate *xlate; |
1219 | struct v4l2_pix_format *pix = &f->fmt.pix; | 1219 | struct v4l2_pix_format *pix = &f->fmt.pix; |
1220 | __u32 pixfmt = pix->pixelformat; | 1220 | __u32 pixfmt = pix->pixelformat; |
1221 | int ret; | ||
1221 | 1222 | ||
1222 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | 1223 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); |
1223 | if (!xlate) { | 1224 | if (!xlate) { |
@@ -1240,8 +1241,13 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd, | |||
1240 | DIV_ROUND_UP(xlate->host_fmt->depth, 8); | 1241 | DIV_ROUND_UP(xlate->host_fmt->depth, 8); |
1241 | pix->sizeimage = pix->height * pix->bytesperline; | 1242 | pix->sizeimage = pix->height * pix->bytesperline; |
1242 | 1243 | ||
1244 | /* camera has to see its format, but the user the original one */ | ||
1245 | pix->pixelformat = xlate->cam_fmt->fourcc; | ||
1243 | /* limit to sensor capabilities */ | 1246 | /* limit to sensor capabilities */ |
1244 | return icd->ops->try_fmt(icd, f); | 1247 | ret = icd->ops->try_fmt(icd, f); |
1248 | pix->pixelformat = xlate->host_fmt->fourcc; | ||
1249 | |||
1250 | return ret; | ||
1245 | } | 1251 | } |
1246 | 1252 | ||
1247 | static int pxa_camera_reqbufs(struct soc_camera_file *icf, | 1253 | static int pxa_camera_reqbufs(struct soc_camera_file *icf, |