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

Commit 67a29544 authored by Krishna Chaitanya Parimi's avatar Krishna Chaitanya Parimi Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Fix AD calibration mode resume backlight issue



AD when set in calibration mode will block all backlight
updates from frameworks. Hence during suspend/blank the
backlight would not be 0 but will be set to the value
set in calibration mode.

Now this is changed as during suspend the backlight is
set to 0 within driver itself. This complicates things by
causing backlight to remain 0 post resume in calibration
mode. Now changing the behavior so that backlight is set
to 0 during suspend and set to the calibration set value
upon resume.

Change-Id: Id0b3919a7034875b3f3a606d00f462ceb21f40ee
Signed-off-by: default avatarKrishna Chaitanya Parimi <cparimi@codeaurora.org>
parent c39a75b0
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -814,6 +814,7 @@ static int mdss_fb_probe(struct platform_device *pdev)
	mfd->bl_min_lvl = 30;
	mfd->ad_bl_level = 0;
	mfd->fb_imgType = MDP_RGBA_8888;
	mfd->calib_mode_bl = 0;

	mfd->pdev = pdev;

@@ -1409,7 +1410,16 @@ static int mdss_fb_blank_unblank(struct msm_fb_data_type *mfd)
		mutex_lock(&mfd->bl_lock);
		if (!mfd->bl_updated) {
			mfd->bl_updated = 1;
			/*
			 * If in AD calibration mode then frameworks would not
			 * be allowed to update backlight hence post unblank
			 * the backlight would remain 0 (0 is set in blank).
			 * Hence resetting back to calibration mode value
			 */
			if (!IS_CALIB_MODE_BL(mfd))
				mdss_fb_set_backlight(mfd, mfd->unset_bl_level);
			else
				mdss_fb_set_backlight(mfd, mfd->calib_mode_bl);
		}
		mutex_unlock(&mfd->bl_lock);
	}
+1 −0
Original line number Diff line number Diff line
@@ -275,6 +275,7 @@ struct msm_fb_data_type {
	int ext_ad_ctrl;
	u32 ext_bl_ctrl;
	u32 calib_mode;
	u32 calib_mode_bl;
	u32 ad_bl_level;
	u32 bl_level;
	u32 bl_scale;
+1 −0
Original line number Diff line number Diff line
@@ -4648,6 +4648,7 @@ int mdss_mdp_ad_input(struct msm_fb_data_type *mfd,
			mdss_fb_set_backlight(mfd, bl);
			mutex_unlock(&mfd->bl_lock);
			mutex_lock(&ad->lock);
			mfd->calib_mode_bl = bl;
		} else {
			pr_warn("should be in calib mode\n");
		}