From: Frank Schaefer Date: Sun, 10 Feb 2013 19:05:14 +0000 (-0300) Subject: [media] em28xx: VIDIOC_ENUM_FRAMESIZES: consider the scaler limits when calculating... X-Git-Tag: upstream/snapshot3+hdmi~3461^2~1967 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c3598e641d447edbaaa05ff0d4cd6da152dc3f4;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [media] em28xx: VIDIOC_ENUM_FRAMESIZES: consider the scaler limits when calculating the minimum frame size Output resolutions <=20% of the input resolution exceed the capabilities of the scaler. Signed-off-by: Frank Schäfer Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index f745617..86fd907 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1405,8 +1405,12 @@ static int vidioc_enum_framesizes(struct file *file, void *priv, /* Report a continuous range */ fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE; - fsize->stepwise.min_width = 48; - fsize->stepwise.min_height = 32; + scale_to_size(dev, EM28XX_HVSCALE_MAX, EM28XX_HVSCALE_MAX, + &fsize->stepwise.min_width, &fsize->stepwise.min_height); + if (fsize->stepwise.min_width < 48) + fsize->stepwise.min_width = 48; + if (fsize->stepwise.min_height < 38) + fsize->stepwise.min_height = 38; fsize->stepwise.max_width = maxw; fsize->stepwise.max_height = maxh; fsize->stepwise.step_width = 1;