From 98d457b3d7ad9f015bb7ceb3a4f0fa2f0144acae Mon Sep 17 00:00:00 2001 From: Ping Li Date: Thu, 20 Apr 2017 18:35:58 -0700 Subject: msm: mdss: Update AD last strength during AD mode switch Currently AD last_str is updated only inside pp_ad_calc_worker thread which is trigged by backlight or ambient light changes. If the number of screen refreshes is too small or user suspends the device before it finishes the scheduled screen refreshes, last_str will be different from the target strength for the current inputs. And when device goes into idle power collapse mode and exits, AD will switch to manual strength mode with last_str for two frames. After that, AD will go back to auto strength mode with the target strength. Since last_str and target strength may be different, flickers will be seen every time AD mode switch happens. This change fixes this above issue by reading the AD strength register and updating the value to last_str when AD mode switches from manual mode to auto strength mode. Change-Id: If68f84a4781230afe21b58c73ff88e59e7e9d416 Signed-off-by: Ping Li --- drivers/video/fbdev/msm/mdss_mdp_pp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp.c b/drivers/video/fbdev/msm/mdss_mdp_pp.c index 2e85072c4cf7..50c26047185c 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pp.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pp.c @@ -2567,6 +2567,8 @@ static int pp_dspp_setup(u32 disp_num, struct mdss_mdp_mixer *mixer, ad_hw->base + MDSS_MDP_REG_AD_TFILT_CTRL); writel_relaxed(ad->cfg.mode | MDSS_AD_AUTO_TRIGGER, ad_hw->base + MDSS_MDP_REG_AD_MODE_SEL); + ad->last_str = 0xFF & readl_relaxed(ad_hw->base + + MDSS_MDP_REG_AD_STR_OUT); } pp_ad_bypass_config(ad, ctl, ad_hw->num, &ad_bypass); -- cgit v1.2.3