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

Commit 6f0fbca4 authored by Prashant Nukala's avatar Prashant Nukala Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: calculate the correct ROI for flipped panels



Calculate the correct ROI for partial update when the panels
are flipped (hflip, vflip or both)

Change-Id: If7110491ad540d7a65f7845455a657459d94485d
Signed-off-by: default avatarVishnuvardhan Prodduturi <vproddut@codeaurora.org>
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent 8e0d47d4
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -679,9 +679,25 @@ static int mdss_mdp_cmd_set_partial_roi(struct mdss_mdp_ctl *ctl)
	if (!ctl->panel_data->panel_info.partial_update_enabled)
		return rc;

	/* set panel col and page addr */
	if (ctl->roi.w && ctl->roi.h && ctl->roi_changed) {
		if (ctl->mfd && (ctl->mfd->panel_orientation & MDP_FLIP_LR))
			ctl->panel_data->panel_info.roi.x =
				ctl->mixer_left->width -
					(ctl->roi.x + ctl->roi.w);
		else
			ctl->panel_data->panel_info.roi.x = ctl->roi.x;
		if (ctl->mfd && (ctl->mfd->panel_orientation & MDP_FLIP_UD))
			ctl->panel_data->panel_info.roi.y =
				ctl->mixer_left->height -
					(ctl->roi.y + ctl->roi.h);
		else
			ctl->panel_data->panel_info.roi.y = ctl->roi.y;
		ctl->panel_data->panel_info.roi.w = ctl->roi.w;
		ctl->panel_data->panel_info.roi.h = ctl->roi.h;

		rc = mdss_mdp_ctl_intf_event(ctl,
			MDSS_EVENT_ENABLE_PARTIAL_ROI, NULL);
	}
	return rc;
}

+0 −7
Original line number Diff line number Diff line
@@ -800,13 +800,6 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
	pipe->dst.w = req->dst_rect.w;
	pipe->dst.h = req->dst_rect.h;

	if (mfd->panel_orientation & MDP_FLIP_LR)
		pipe->dst.x = pipe->mixer_left->width
			- pipe->dst.x - pipe->dst.w;
	if (mfd->panel_orientation & MDP_FLIP_UD)
		pipe->dst.y = pipe->mixer_left->height
			- pipe->dst.y - pipe->dst.h;

	pipe->horz_deci = req->horz_deci;
	pipe->vert_deci = req->vert_deci;

+10 −0
Original line number Diff line number Diff line
@@ -1307,6 +1307,7 @@ static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe,
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();
	struct mdss_rect sci, dst, src;
	bool rotation = false;
	u32 panel_orientation = 0;

	pr_debug("ctl: %d pnum=%d wh=%dx%d src={%d,%d,%d,%d} dst={%d,%d,%d,%d}\n",
			pipe->mixer_left->ctl->num, pipe->num,
@@ -1362,6 +1363,15 @@ static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe,
		}
	}

	if (!(pipe->mixer_left->rotator_mode)) {
		panel_orientation = pipe->mixer_left->ctl->mfd->panel_orientation;
		if (panel_orientation & MDP_FLIP_LR)
			dst.x =  pipe->mixer_left->ctl->roi.w - dst.x - dst.w;

		if (panel_orientation & MDP_FLIP_UD)
			dst.y =  pipe->mixer_left->ctl->roi.h - dst.y - dst.h;
	}

	src_size = (src.h << 16) | src.w;
	src_xy = (src.y << 16) | src.x;
	dst_size = (dst.h << 16) | dst.w;