diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-08-26 14:48:44 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-08-26 14:48:44 -0700 |
| commit | 01e1d840d78d2b4a431bd967315240c28a3a809b (patch) | |
| tree | 583325d42acd8f20236eded39a30cb652175a4f1 /drivers/video/fbdev | |
| parent | 9970bd4123a50f3bfff157db586189ad4c832635 (diff) | |
| parent | ef0912c52ef993c06497515615505ce20f75d72a (diff) | |
Merge "msm: mdss: add additional LM checks for dest scalar validation"
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_layer.c | 18 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_panel.h | 9 |
2 files changed, 22 insertions, 5 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_layer.c b/drivers/video/fbdev/msm/mdss_mdp_layer.c index ccc7e4a4ebf5..77f5883ee40d 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_layer.c +++ b/drivers/video/fbdev/msm/mdss_mdp_layer.c @@ -137,8 +137,12 @@ static int mdss_mdp_destination_scaler_pre_validate(struct mdss_mdp_ctl *ctl, if ((ds_data->lm_width > get_panel_xres(pinfo)) || (ds_data->lm_height > get_panel_yres(pinfo)) || (ds_data->lm_width == 0) || - (ds_data->lm_height == 0)) { - pr_err("Invalid LM width / height setting\n"); + (ds_data->lm_height == 0) || + (is_dsc_compression(pinfo) && + !is_lm_configs_dsc_compatible(pinfo, + ds_data->lm_width, ds_data->lm_height))) { + pr_err("Invalid left LM {%d,%d} setting\n", + ds_data->lm_width, ds_data->lm_height); return -EINVAL; } @@ -163,8 +167,12 @@ static int mdss_mdp_destination_scaler_pre_validate(struct mdss_mdp_ctl *ctl, if ((ds_data->lm_width > get_panel_xres(pinfo)) || (ds_data->lm_height > get_panel_yres(pinfo)) || (ds_data->lm_width == 0) || - (ds_data->lm_height == 0)) { - pr_err("Invalid LM width / height setting\n"); + (ds_data->lm_height == 0) || + (is_dsc_compression(pinfo) && + !is_lm_configs_dsc_compatible(pinfo, + ds_data->lm_width, ds_data->lm_height))) { + pr_err("Invalid right LM {%d,%d} setting\n", + ds_data->lm_width, ds_data->lm_height); return -EINVAL; } @@ -174,7 +182,7 @@ static int mdss_mdp_destination_scaler_pre_validate(struct mdss_mdp_ctl *ctl, */ ctl->mixer_right->width = ds_data->lm_width; ctl->mixer_right->height = ds_data->lm_height; - pr_info("Update mixer-right width/height: %dx%d\n", + pr_debug("Update mixer-right width/height: %dx%d\n", ds_data->lm_width, ds_data->lm_height); if (ctl->mixer_left && diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h index bde137269422..1137c4475cab 100644 --- a/drivers/video/fbdev/msm/mdss_panel.h +++ b/drivers/video/fbdev/msm/mdss_panel.h @@ -900,6 +900,15 @@ static inline bool is_dsc_compression(struct mdss_panel_info *pinfo) return false; } +static inline bool is_lm_configs_dsc_compatible(struct mdss_panel_info *pinfo, + u32 width, u32 height) +{ + if ((width % pinfo->dsc.slice_width) || + (height % pinfo->dsc.slice_height)) + return false; + return true; +} + int mdss_register_panel(struct platform_device *pdev, struct mdss_panel_data *pdata); |
