Skip to content

Commit

Permalink
V4L/DVB (10081): pxa-camera: call try_fmt() camera device method with…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent 64f5905 commit bf50715
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/media/video/pxa_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
const struct soc_camera_format_xlate *xlate;
struct v4l2_pix_format *pix = &f->fmt.pix;
__u32 pixfmt = pix->pixelformat;
int ret;

xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) {
Expand All @@ -1240,8 +1241,13 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
DIV_ROUND_UP(xlate->host_fmt->depth, 8);
pix->sizeimage = pix->height * pix->bytesperline;

/* camera has to see its format, but the user the original one */
pix->pixelformat = xlate->cam_fmt->fourcc;
/* limit to sensor capabilities */
return icd->ops->try_fmt(icd, f);
ret = icd->ops->try_fmt(icd, f);
pix->pixelformat = xlate->host_fmt->fourcc;

return ret;
}

static int pxa_camera_reqbufs(struct soc_camera_file *icf,
Expand Down

0 comments on commit bf50715

Please sign in to comment.