camera:add limit ipp scale ratio when work with camera

This commit is contained in:
ddl 2010-12-17 16:50:31 +08:00
parent f8387eb316
commit 659643f1fa

View File

@ -1080,9 +1080,14 @@ static int rk29_camera_try_fmt(struct soc_camera_device *icd,
ret = v4l2_subdev_call(sd, video, try_fmt, f);
pix->pixelformat = pixfmt;
#ifdef CONFIG_VIDEO_RK29_WORK_IPP
if ((pix->width != usr_w) || (pix->height != usr_h)) {
if ((pix->width > usr_w) && (pix->height > usr_h)) {
pix->width = usr_w;
pix->height = usr_h;
} else if ((pix->width < usr_w) && (pix->height < usr_h)) {
if (((usr_w>>1) < pix->width) && ((usr_h>>1) < pix->height)) {
pix->width = usr_w;
pix->height = usr_h;
}
}
#endif