summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeera Sundaram Sankaran <veeras@codeaurora.org>2016-08-22 19:03:31 -0700
committerVeera Sundaram Sankaran <veeras@codeaurora.org>2016-08-22 19:15:18 -0700
commitef0912c52ef993c06497515615505ce20f75d72a (patch)
treedc0e0a3d19bedfbeba701775917800ccbed48e35
parentc605e110ab18604981481a7b502da54640b620bc (diff)
msm: mdss: add additional LM checks for dest scalar validation
Add compatibility checks for the new LM configs sent by dest scalar with the DSC slice width/height during validation. Without this check, the DSC config check would fail at a later point during ctl start. Change-Id: I55e483be5629cfe26cca3b740d206845a1caa903 Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_layer.c18
-rw-r--r--drivers/video/fbdev/msm/mdss_panel.h9
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 600701041309..28696e2a0b8c 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);