From db3c867d3825729c72863b6e2f08c84637f7f300 Mon Sep 17 00:00:00 2001 From: Ujwal Patel Date: Fri, 12 Jun 2015 19:57:12 -0700 Subject: msm: mdss: fix dst_x adjustments when source split is disabled In order to handle different use-cases, mixer ROIs and/or dst_x of a pipe is modified and re-adjusted. In one of these use-cases, when source split is disabled, re-adjustment was missing causing HW hangs or unexpected layer positions. Fix these adjustments. Change-Id: I7cda887874aad97bca16b63ca5a9eac303fa63a4 Signed-off-by: Ujwal Patel --- drivers/video/fbdev/msm/mdss_mdp_pipe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c index 9b435b59df69..15f47ed4ae93 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c @@ -1621,6 +1621,7 @@ static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe, if (!pipe->mixer_left->ctl->is_video_mode && (pipe->mixer_left->type != MDSS_MDP_MIXER_TYPE_WRITEBACK)) { + struct mdss_rect ctl_roi = pipe->mixer_left->ctl->roi; bool is_right_mixer = pipe->mixer_left->is_right_mixer; /* sctl can be NULL, check validity before use */ @@ -1630,6 +1631,7 @@ static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe, struct mdss_mdp_ctl *main_ctl = mdss_mdp_get_main_ctl(pipe->mixer_left->ctl); + /* adjust roi or dst_x before crop is applied */ if (pipe->src_split_req && sctl) ctl_roi.w += sctl->roi.w; else if (mdata->has_src_split && is_right_mixer && main_ctl) @@ -1637,8 +1639,9 @@ static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe, mdss_mdp_crop_rect(&src, &dst, &ctl_roi); - if (is_right_mixer && main_ctl) { - /* left + right */ + /* re-adjust dst_x */ + if (mdata->has_src_split && is_right_mixer && main_ctl) { + /* update valid on left + right */ if (main_ctl->valid_roi) dst.x += main_ctl->roi.w; } -- cgit v1.2.3