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

This commit is contained in:
Linux Build Service Account 2016-11-28 23:57:59 -08:00 committed by Gerrit - the friendly Code Review server
commit f2f8e391d8
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

@ -1134,7 +1134,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;
@ -1512,27 +1511,22 @@ 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",
if (temp > mfd->panel_info->bl_max) {
pr_warn("%s: invalid bl level\n",
__func__);
temp = mfd->panel_info->bl_max;
}
if (mfd->bl_scale > 1024) {
pr_warn("%s: invalid bl scale\n",
__func__);
mfd->bl_scale = 1024;
}
/*
* bl_scale is the numerator of
* scaling fraction (x/1024)
*/
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;
temp = mfd->panel_info->bl_max;
}
if (mfd->bl_scale > 1024) {
pr_warn("%s: invalid bl scale\n",
__func__);
mfd->bl_scale = 1024;
}
/*
* bl_scale is the numerator of
* scaling fraction (x/1024)
*/
temp = (temp * mfd->bl_scale) / 1024;
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

@ -4405,9 +4405,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);