[media] v4l: s5p-tv: mixer: fix setup of VP scaling
authorTomasz Stanislawski <t.stanislaws@samsung.com>
Fri, 25 Nov 2011 08:56:18 +0000 (05:56 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 11 Jan 2012 01:19:40 +0000 (23:19 -0200)
Adjusting of Video Processor's scaling factors was flawed. It bounded scaling
to range 1/16 to 1/1. The correct range should be 1/4 to 4/1. This patch fixes
this bug.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/s5p-tv/mixer_vp_layer.c

index e41ec2ec45f800d4be9049fe2488b1989cb6da94..3d13a636877be73ce50079a3d286014b6182b3c3 100644 (file)
@@ -172,10 +172,10 @@ static void mxr_vp_fix_geometry(struct mxr_layer *layer,
                y_center = src->y_offset + src->height / 2;
 
                /* ensure scaling is between 0.25x .. 16x */
-               src->width = clamp(src->width, round_up(dst->width, 4),
-                       dst->width * 16);
-               src->height = clamp(src->height, round_up(dst->height, 4),
-                       dst->height * 16);
+               src->width = clamp(src->width, round_up(dst->width / 16, 4),
+                       dst->width * 4);
+               src->height = clamp(src->height, round_up(dst->height / 16, 4),
+                       dst->height * 4);
 
                /* hardware limits */
                src->width = clamp(src->width, 32U, 2047U);