[media] s5p-fimc: update checking scaling ratio range
authorHyunwoong Kim <khw0178.kim@samsung.com>
Wed, 29 Dec 2010 01:12:43 +0000 (22:12 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 21 Mar 2011 23:31:40 +0000 (20:31 -0300)
commit1b09f292eb99fd6a3601e8421c463905dbb0a866
treeb4b2f033ed5846e98c1cd4d3392a522cc504aff9
parent70f66ea2aafbd9022a5dcdfd823538e540873585
[media] s5p-fimc: update checking scaling ratio range

Horizontal and vertical scaling range are according to the following equations.
If (SRC_Width >= 64 x DST_Width) { Exit(-1);  /* Out of Horizontal scale range}
If (SRC_Height >= 64 x DST_Height) { Exit(-1);  /* Out of Vertical scale range}

fimc_check_scaler_ratio() is used to check if horizontal and vertical
scale range are valid or not. To use fimc_check_scaler_ratio,
source and destination format should be set by VIDIOC_S_FMT.
And in case of scaling up, it doesn't have to check the scale range.

Reviewed-by: Jonghun Han <jonghun.han@samsung.com>
Signed-off-by: Hyunwoong Kim <khw0178.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/s5p-fimc/fimc-capture.c
drivers/media/video/s5p-fimc/fimc-core.c
drivers/media/video/s5p-fimc/fimc-core.h