Merge "msm: mdss: add additional LM checks for dest scalar validation"
This commit is contained in:
commit
01e1d840d7
2 changed files with 22 additions and 5 deletions
|
@ -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 &&
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue