diff options
| author | Benet Clark <benetc@codeaurora.org> | 2013-11-27 11:36:02 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:24:08 -0700 |
| commit | ae8ccdf2f36f4e3edf297a48e5affeb4adad4ce8 (patch) | |
| tree | adc9a7b183a3a280c18209bc1869311c7e163da4 /drivers/video/fbdev | |
| parent | be6ab25f5e1fc5cbd25c2343959a78e2330f2fe5 (diff) | |
msm: mdss: Fix error cases in AD config
The BL linearity LUT was not being copied correctly. This change allows
AD config to exit with errors correctly if the BL linearity LUT is not
passed correctly.
Change-Id: I491a7cc4b168b7691c65cbc2d2963f8a7a3f804d
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_pp.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp.c b/drivers/video/fbdev/msm/mdss_mdp_pp.c index ada484637630..259f27d57f41 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pp.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pp.c @@ -3619,7 +3619,6 @@ int mdss_mdp_ad_config(struct msm_fb_data_type *mfd, struct mdss_ad_init_cfg *init_cfg) { struct mdss_ad_info *ad; - struct mdss_mdp_ctl *ctl; struct msm_fb_data_type *bl_mfd; int lin_ret = -1, inv_ret = -1, ret = 0; u32 ratio_temp, shift = 0; @@ -3642,10 +3641,12 @@ int mdss_mdp_ad_config(struct msm_fb_data_type *mfd, if (init_cfg->params.init.bl_lin_len == AD_BL_LIN_LEN) { lin_ret = copy_from_user(&ad->bl_lin, init_cfg->params.init.bl_lin, - AD_BL_LIN_LEN * sizeof(uint32_t)); + init_cfg->params.init.bl_lin_len * + sizeof(uint32_t)); inv_ret = copy_from_user(&ad->bl_lin_inv, init_cfg->params.init.bl_lin_inv, - AD_BL_LIN_LEN * sizeof(uint32_t)); + init_cfg->params.init.bl_lin_len * + sizeof(uint32_t)); if (lin_ret || inv_ret) ret = -ENOMEM; ratio_temp = mfd->panel_info->bl_max / AD_BL_LIN_LEN; @@ -3654,13 +3655,14 @@ int mdss_mdp_ad_config(struct msm_fb_data_type *mfd, shift++; } ad->bl_bright_shift = shift; - } else if (init_cfg->params.init.bl_lin_len) { + } else { ret = -EINVAL; } - if (!lin_ret && !inv_ret) + if (ret) { + ad->state &= ~PP_AD_STATE_BL_LIN; + goto ad_config_exit; + } else ad->state |= PP_AD_STATE_BL_LIN; - else - ad->state &= !PP_AD_STATE_BL_LIN; ad->sts |= PP_AD_STS_DIRTY_INIT; } else if (init_cfg->ops & MDP_PP_AD_CFG) { @@ -3686,8 +3688,8 @@ int mdss_mdp_ad_config(struct msm_fb_data_type *mfd, ad->mfd = mfd; ad->bl_mfd = bl_mfd; } +ad_config_exit: mutex_unlock(&ad->lock); - ctl = mfd_to_ctl(mfd); return ret; } |
