msm: mdss: Add AD BL ATT debug log and checks

Enable more checks and add more debug logs for AD BL attenuation
functionality tests.

Change-Id: I088657bdbed553970c3550aab5bdc399970d9b23
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
This commit is contained in:
Ping Li 2014-06-26 17:09:54 -07:00 committed by David Keitel
parent ed041f76ef
commit 945c0c58a4
2 changed files with 4 additions and 2 deletions

View file

@ -986,6 +986,7 @@ void mdss_fb_set_backlight(struct msm_fb_data_type *mfd, u32 bkl_lvl)
mfd->bl_level = bkl_lvl;
return;
}
pr_debug("backlight sent to panel :%d\n", temp);
pdata->set_backlight(pdata, temp);
mfd->bl_level = bkl_lvl;
mfd->bl_level_scaled = temp;

View file

@ -4876,7 +4876,8 @@ static int pp_ad_attenuate_bl(u32 bl, u32 *bl_out,
}
ret = mdss_mdp_get_ad(mfd, &ad);
if (ret || !ad) {
if (ret || !ad || !ad->bl_mfd || !ad->bl_mfd->panel_info ||
!ad->bl_mfd->panel_info->bl_max || !ad->bl_att_lut) {
pr_err("Failed to get the ad.\n");
return ret;
}
@ -4892,7 +4893,7 @@ static int pp_ad_attenuate_bl(u32 bl, u32 *bl_out,
shift++;
}
n = bl >> shift;
if (n >= AD_BL_ATT_LUT_LEN) {
if (n >= (AD_BL_ATT_LUT_LEN - 1)) {
pr_err("Invalid index for BL attenuation: %d.\n", n);
return ret;
}