Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 392d9e1d authored by Tomasz Stanislawski's avatar Tomasz Stanislawski Committed by Mauro Carvalho Chehab
Browse files

[media] v4l: s5p-tv: mixer: fix setup of VP scaling



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: default avatarTomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0d066d3f
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -172,10 +172,10 @@ static void mxr_vp_fix_geometry(struct mxr_layer *layer,
		y_center = src->y_offset + src->height / 2;
		y_center = src->y_offset + src->height / 2;


		/* ensure scaling is between 0.25x .. 16x */
		/* ensure scaling is between 0.25x .. 16x */
		src->width = clamp(src->width, round_up(dst->width, 4),
		src->width = clamp(src->width, round_up(dst->width / 16, 4),
			dst->width * 16);
			dst->width * 4);
		src->height = clamp(src->height, round_up(dst->height, 4),
		src->height = clamp(src->height, round_up(dst->height / 16, 4),
			dst->height * 16);
			dst->height * 4);


		/* hardware limits */
		/* hardware limits */
		src->width = clamp(src->width, 32U, 2047U);
		src->width = clamp(src->width, 32U, 2047U);