From 8df91abd3e807f3d9bf62e1257fc8a80fcd3cc45 Mon Sep 17 00:00:00 2001 From: Ujwal Patel Date: Wed, 21 Oct 2015 14:33:46 -0700 Subject: [PATCH] msm: mdss: do not skip pipe programming if roi changed Current driver has an optimization where if pipe parameters are not changed between consecutive updates then it will skip pipe's HW register programming. However when partial update is enabled and ROI is changed compared to previous update, pipe's HW programming should not be skipped because HW is programmed with stale ROI for that given pipe. Fix this by forcing pipe HW programming update if ROI is changed. Change-Id: Iebff043ecbb35b22ffbe344bdffa830602437252 Signed-off-by: Ujwal Patel --- drivers/video/fbdev/msm/mdss_mdp.h | 20 ++++++++++++++++++++ drivers/video/fbdev/msm/mdss_mdp_overlay.c | 9 +++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp.h b/drivers/video/fbdev/msm/mdss_mdp.h index b782f77d4e3f..fbf7e5ca8eb0 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.h +++ b/drivers/video/fbdev/msm/mdss_mdp.h @@ -750,6 +750,26 @@ enum mdss_mdp_clt_intf_event_flags { #define mfd_to_wb(mfd) (((struct mdss_overlay_private *)\ (mfd->mdp.private1))->wb) +/** + * - mdss_mdp_is_roi_changed + * @mfd - pointer to mfd + * + * Function returns true if roi is changed for any layer mixer of a given + * display, false otherwise. + */ +static inline bool mdss_mdp_is_roi_changed(struct msm_fb_data_type *mfd) +{ + struct mdss_mdp_ctl *ctl; + + if (!mfd) + return false; + + ctl = mfd_to_ctl(mfd); /* returns master ctl */ + + return ctl->mixer_left->roi_changed || + (is_split_lm(mfd) ? ctl->mixer_right->roi_changed : false); +} + /** * - mdss_mdp_is_both_lm_valid * @main_ctl - pointer to a main ctl diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c index d042bb3ff409..a81588eeee94 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c +++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c @@ -1516,8 +1516,13 @@ static int __overlay_queue_pipes(struct msm_fb_data_type *mfd) if (buf && (buf->state == MDP_BUF_STATE_READY)) { buf->state = MDP_BUF_STATE_ACTIVE; ret = mdss_mdp_data_map(buf, false, DMA_TO_DEVICE); - } else if (!pipe->params_changed) { - /* nothing to update so continue with next */ + } else if (!pipe->params_changed && + !mdss_mdp_is_roi_changed(pipe->mfd)) { + + /* + * no update for the given pipe nor any change in the + * ROI so skip pipe programming and continue with next. + */ continue; } else if (buf) { BUG_ON(buf->state != MDP_BUF_STATE_ACTIVE);