camera:add limit ipp scale ratio when work with camera
authorddl <ddl@rock-chips.com>
Fri, 17 Dec 2010 08:50:31 +0000 (16:50 +0800)
committerddl <ddl@rock-chips.com>
Fri, 17 Dec 2010 09:19:00 +0000 (17:19 +0800)
drivers/media/video/rk29_camera_oneframe.c

index 14e2821490acc3d20babe7a3e220e52afd91b8bc..6e1f7578564783cb5e1cacac92c239c8e8be3023 100644 (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