From 659643f1fa4d108a1cd9448e32d1ba354d37e7af Mon Sep 17 00:00:00 2001 From: ddl Date: Fri, 17 Dec 2010 16:50:31 +0800 Subject: [PATCH] camera:add limit ipp scale ratio when work with camera --- drivers/media/video/rk29_camera_oneframe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/rk29_camera_oneframe.c b/drivers/media/video/rk29_camera_oneframe.c index 14e2821490ac..6e1f75785647 100644 --- a/drivers/media/video/rk29_camera_oneframe.c +++ b/drivers/media/video/rk29_camera_oneframe.c @@ -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 -- 2.34.1