msm: mdss: do register programming only when parameters have changed

Add a check to compare whether parameters have changed from previously
set parameters and only then do reprogramming of structure. This can
save some time by not needing to reprogram the hardware and makes it
easier to debug by showing logs only when there are some changes in
parameters.

Change-Id: Ic26db2906358594fa6475010df6d6e05bc0cb4ad
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
This commit is contained in:
Jeevan Shriram 2014-09-18 10:42:18 -07:00 committed by David Keitel
parent 2ca53b1502
commit 553db0202e
2 changed files with 14 additions and 16 deletions

View file

@ -632,15 +632,6 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
if (ret)
return ret;
pipe = mdss_mdp_get_staged_pipe(mdp5_data->ctl, mixer_mux,
req->z_order, left_blend_pipe != NULL);
if (pipe && pipe->ndx != req->id) {
pr_debug("replacing pnum=%d at stage=%d mux=%d id:0x%x %s\n",
pipe->num, req->z_order, mixer_mux, req->id,
left_blend_pipe ? "right blend" : "left blend");
mdss_mdp_mixer_pipe_unstage(pipe, pipe->mixer_left);
}
mixer = mdss_mdp_mixer_get(mdp5_data->ctl, mixer_mux);
if (!mixer) {
pr_err("unable to get mixer\n");
@ -780,6 +771,12 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
if (mfd->panel_orientation)
req->flags ^= mfd->panel_orientation;
req->priority = pipe->priority;
if (!memcmp(req, &pipe->req_data, sizeof(*req))) {
pr_debug("skipping pipe_reconfiguration\n");
goto skip_reconfigure;
}
pipe->flags = req->flags;
if (bwc_enabled && !mdp5_data->mdata->has_bwc) {
pr_err("BWC is not supported in MDP version %x\n",
@ -870,10 +867,6 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
}
pipe->bg_color = req->bg_color;
req->id = pipe->ndx;
req->priority = pipe->priority;
pipe->req_data = *req;
if (pipe->type == MDSS_MDP_PIPE_TYPE_CURSOR)
goto cursor_done;
@ -969,17 +962,21 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
goto exit_fail;
}
cursor_done:
pipe->params_changed++;
req->id = pipe->ndx;
cursor_done:
req->vert_deci = pipe->vert_deci;
pipe->req_data = *req;
pipe->params_changed++;
skip_reconfigure:
*ppipe = pipe;
mdss_mdp_pipe_unmap(pipe);
return ret;
exit_fail:
mdss_mdp_pipe_unmap(pipe);

View file

@ -1033,6 +1033,7 @@ static void mdss_mdp_pipe_free(struct kref *kref)
pipe->mfd = NULL;
pipe->mixer_left = pipe->mixer_right = NULL;
memset(&pipe->scale, 0, sizeof(struct mdp_scale_data));
memset(&pipe->req_data, 0, sizeof(pipe->req_data));
}
static bool mdss_mdp_check_pipe_in_use(struct mdss_mdp_pipe *pipe)