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

Commit 98d457b3 authored by Ping Li's avatar Ping Li Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarPing Li <pingli@codeaurora.org>
parent 3d82d664
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);