msm: mdss: Remove backlight min level checks during backlight scaling

There is currently a check to prevent backlight scaling when the backlight
level is below the minimum level. This min level and scale are both sent by
userspace. There should be no check in driver comparing backlight to min
level when doing scaling. That check will be done in user mode. The
driver should have the flexibility to do scaling in all scenarios.

CRs-Fixed: 1090387
Change-Id: I6b036db5169c89091ca452c68d6773d9df6d5e06
Signed-off-by: Benet Clark <benetc@codeaurora.org>
This commit is contained in:
Benet Clark 2016-08-09 18:14:27 -07:00
parent 827d048300
commit 83147f1a66
4 changed files with 16 additions and 31 deletions

View file

@ -1603,10 +1603,6 @@ int mdp3_validate_scale_config(struct mdp_bl_scale_data *data)
pr_err("%s invalid bl_scale\n", __func__);
return -EINVAL;
}
if (data->min_lvl > MDP_HISTOGRAM_BL_LEVEL_MAX) {
pr_err("%s invalid bl_min_lvl\n", __func__);
return -EINVAL;
}
return 0;
}
@ -1810,9 +1806,7 @@ static int mdp3_bl_scale_config(struct msm_fb_data_type *mfd,
mutex_lock(&mfd->bl_lock);
curr_bl = mfd->bl_level;
mfd->bl_scale = data->scale;
mfd->bl_min_lvl = data->min_lvl;
pr_debug("update scale = %d, min_lvl = %d\n", mfd->bl_scale,
mfd->bl_min_lvl);
pr_debug("update scale = %d\n", mfd->bl_scale);
/* update current backlight to use new scaling*/
mdss_fb_set_backlight(mfd, curr_bl);

View file

@ -1131,7 +1131,6 @@ static int mdss_fb_probe(struct platform_device *pdev)
mfd->bl_level = 0;
mfd->bl_scale = 1024;
mfd->bl_min_lvl = 30;
mfd->ad_bl_level = 0;
mfd->fb_imgType = MDP_RGBA_8888;
mfd->calib_mode_bl = 0;
@ -1507,7 +1506,6 @@ static void mdss_fb_scale_bl(struct msm_fb_data_type *mfd, u32 *bl_lvl)
u32 temp = *bl_lvl;
pr_debug("input = %d, scale = %d\n", temp, mfd->bl_scale);
if (temp >= mfd->bl_min_lvl) {
if (temp > mfd->panel_info->bl_max) {
pr_warn("%s: invalid bl level\n",
__func__);
@ -1524,10 +1522,6 @@ static void mdss_fb_scale_bl(struct msm_fb_data_type *mfd, u32 *bl_lvl)
*/
temp = (temp * mfd->bl_scale) / 1024;
/*if less than minimum level, use min level*/
if (temp < mfd->bl_min_lvl)
temp = mfd->bl_min_lvl;
}
pr_debug("output = %d\n", temp);
(*bl_lvl) = temp;

View file

@ -299,7 +299,6 @@ struct msm_fb_data_type {
u32 ad_bl_level;
u32 bl_level;
u32 bl_scale;
u32 bl_min_lvl;
u32 unset_bl_level;
bool allow_bl_update;
u32 bl_level_scaled;

View file

@ -4129,9 +4129,7 @@ static int mdss_bl_scale_config(struct msm_fb_data_type *mfd,
mutex_lock(&mfd->bl_lock);
curr_bl = mfd->bl_level;
mfd->bl_scale = data->scale;
mfd->bl_min_lvl = data->min_lvl;
pr_debug("update scale = %d, min_lvl = %d\n", mfd->bl_scale,
mfd->bl_min_lvl);
pr_debug("update scale = %d\n", mfd->bl_scale);
/* update current backlight to use new scaling*/
mdss_fb_set_backlight(mfd, curr_bl);