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

Commit b0533818 authored by Adrian Salido-Moreno's avatar Adrian Salido-Moreno
Browse files

msm: mdss: fix sw calculation of interlace x offset



Interlacing is handled in software by changing the original height to
half which would become the width after rotation. In cases of 90 degree
rotation the height becomes the displayed width so in that case the
source x offset needs to be updated to half of intended similar to
source width.

CRs-Fixed: 545926
Change-Id: I0de9adb243d6162f5387b1ebc2821141eea4b111
Signed-off-by: default avatarAdrian Salido-Moreno <adrianm@codeaurora.org>
parent d6e87cbf
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -289,9 +289,7 @@ static int mdss_mdp_overlay_rotator_setup(struct msm_fb_data_type *mfd,
	if (req->flags & MDP_DEINTERLACE) {
		rot->flags |= MDP_DEINTERLACE;
		rot->src_rect.h /= 2;
		rot->src_rect.y /= 2;
		if (rot->src_rect.y % 2)
			rot->src_rect.y++;
		rot->src_rect.y = DIV_ROUND_UP(rot->src_rect.y, 2);
	}

	ret = mdss_mdp_rotator_setup(rot);
@@ -583,13 +581,12 @@ static int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,

	if (pipe->flags & MDP_DEINTERLACE) {
		if (pipe->flags & MDP_SOURCE_ROTATED_90) {
			pipe->src.x = DIV_ROUND_UP(pipe->src.x, 2);
			pipe->src.w /= 2;
			pipe->img_width /= 2;
		} else {
			pipe->src.h /= 2;
			pipe->src.y /= 2;
			if (pipe->src.y % 2)
				pipe->src.y++;
			pipe->src.y = DIV_ROUND_UP(pipe->src.y, 2);
		}
	}