From: ddl Date: Sat, 13 Aug 2011 02:43:19 +0000 (+0800) Subject: camera: fix try_fmt function bug X-Git-Tag: firefly_0821_release~9776 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c615af6fab9b2fb30bc8aa025a1c330ebdafe3a8;p=firefly-linux-kernel-4.4.55.git camera: fix try_fmt function bug --- diff --git a/drivers/media/video/rk29_camera_oneframe.c b/drivers/media/video/rk29_camera_oneframe.c index 4365f771a005..8271743402ef 100755 --- a/drivers/media/video/rk29_camera_oneframe.c +++ b/drivers/media/video/rk29_camera_oneframe.c @@ -1285,7 +1285,7 @@ static int rk29_camera_try_fmt(struct soc_camera_device *icd, ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); if (ret < 0) goto RK29_CAMERA_TRY_FMT_END; - + RK29CAMERA_DG("%s mf.width:%d mf.height:%d\n",__FUNCTION__,mf.width,mf.height); #ifdef CONFIG_VIDEO_RK29_WORK_IPP if ((mf.width > usr_w) && (mf.height > usr_h)) { if (is_capture) { @@ -1298,7 +1298,9 @@ static int rk29_camera_try_fmt(struct soc_camera_device *icd, pix->width = usr_w; pix->height = usr_h; } else { - RK29CAMERA_TR("vipmem for IPP is overflow, This resolution(%dx%d -> %dx%d) is invalidate!\n",pix->width,pix->height,usr_w,usr_h); + RK29CAMERA_TR("vipmem for IPP is overflow, This resolution(%dx%d -> %dx%d) is invalidate!\n",mf.width,mf.height,usr_w,usr_h); + pix->width = mf.width; + pix->height = mf.height; } } else if ((mf.width < usr_w) && (mf.height < usr_h)) { if (((usr_w>>1) < mf.width) && ((usr_h>>1) < mf.height)) { @@ -1311,10 +1313,14 @@ static int rk29_camera_try_fmt(struct soc_camera_device *icd, pix->width = usr_w; pix->height = usr_h; } else { - RK29CAMERA_TR("vipmem for IPP is overflow, This resolution(%dx%d -> %dx%d) is invalidate!\n",pix->width,pix->height,usr_w,usr_h); + RK29CAMERA_TR("vipmem for IPP is overflow, This resolution(%dx%d -> %dx%d) is invalidate!\n",mf.width,mf.height,usr_w,usr_h); + pix->width = mf.width; + pix->height = mf.height; } } else { - RK29CAMERA_TR("The aspect ratio(%dx%d/%dx%d) is bigger than 2 !\n",pix->width,pix->height,usr_w,usr_h); + RK29CAMERA_TR("The aspect ratio(%dx%d/%dx%d) is bigger than 2 !\n",mf.width,mf.height,usr_w,usr_h); + pix->width = mf.width; + pix->height = mf.height; } } #else