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

Commit a173233c authored by Carl Vanderlip's avatar Carl Vanderlip Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Store AD backlight notification function



Store Assertive Display backlight notification function while locked to
prevent race condition where AD is disabled while lock is released,
setting function pointer to NULL.

Change-Id: I7996a29595854ed8e50d0fff663a779c3ccd388f
Signed-off-by: default avatarCarl Vanderlip <carlv@codeaurora.org>
parent c3dced49
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -626,6 +626,7 @@ static void mdss_fb_scale_bl(struct msm_fb_data_type *mfd, u32 *bl_lvl)
void mdss_fb_set_backlight(struct msm_fb_data_type *mfd, u32 bkl_lvl)
{
	struct mdss_panel_data *pdata;
	int (*update_ad_input)(struct msm_fb_data_type *mfd);
	u32 temp = bkl_lvl;

	if (((!mfd->panel_power_on && mfd->dcm_state != DCM_ENTER)
@@ -658,9 +659,10 @@ void mdss_fb_set_backlight(struct msm_fb_data_type *mfd, u32 bkl_lvl)
		mfd->bl_level_old = temp;

		if (mfd->mdp.update_ad_input) {
			update_ad_input = mfd->mdp.update_ad_input;
			mutex_unlock(&mfd->bl_lock);
			/* Will trigger ad_setup which will grab bl_lock */
			mfd->mdp.update_ad_input(mfd);
			update_ad_input(mfd);
			mutex_lock(&mfd->bl_lock);
		}
	}
+1 −1
Original line number Diff line number Diff line
@@ -2859,7 +2859,7 @@ static int mdss_ad_init_checks(struct msm_fb_data_type *mfd)
		return -EHOSTDOWN;
	}
	if (mixer_num > MDSS_AD_MAX_MIXERS) {
		pr_warn("too many mixers, not supported, %d", mixer_num);
		pr_debug("too many mixers, not supported, %d", mixer_num);
		return ret;
	}