Browse Source

disp: msm: sde: update rc checks for mask configuration

Rounded corner mask layer height/width should match the panel height
and width. Change updates rounded corner mask configuration check
to ensure that dimensons match.

Change-Id: I97f544b0a7df1ebea6d8aa3321813649ebc69d82
Signed-off-by: Gopikrishnaiah Anandan <[email protected]>
Gopikrishnaiah Anandan 3 years ago
parent
commit
51de59d06b
2 changed files with 11 additions and 1 deletions
  1. 2 0
      include/uapi/display/drm/msm_drm_pp.h
  2. 9 1
      msm/sde/sde_hw_rc.c

+ 2 - 0
include/uapi/display/drm/msm_drm_pp.h

@@ -681,6 +681,8 @@ struct drm_msm_rc_mask_cfg {
 	__u64 cfg_param_07;
 	__u32 cfg_param_08;
 	__u64 cfg_param_09[RC_DATA_SIZE_MAX];
+	__u32 height;
+	__u32 width;
 };
 
 #define FP16_SUPPORTED

+ 9 - 1
msm/sde/sde_hw_rc.c

@@ -588,6 +588,13 @@ static int sde_hw_rc_check_mask_cfg(
 		return -EINVAL;
 	}
 
+	if (hw_cfg->panel_height != rc_mask_cfg->height ||
+		rc_mask_cfg->width != hw_cfg->panel_width) {
+		SDE_ERROR("RC mask Layer: h %d w %d panel: h %d w %d mismatch\n",
+				rc_mask_cfg->height, rc_mask_cfg->width,
+				hw_cfg->panel_height, hw_cfg->panel_width);
+		return -EINVAL;
+	}
 	flags = rc_mask_cfg->flags;
 	cfg_param_01 = rc_mask_cfg->cfg_param_01;
 	cfg_param_02 = rc_mask_cfg->cfg_param_02;
@@ -728,7 +735,8 @@ int sde_hw_rc_check_mask(struct sde_hw_dspp *hw_dspp, void *cfg)
 
 	if (hw_cfg->len != sizeof(struct drm_msm_rc_mask_cfg) ||
 			!hw_cfg->payload) {
-		SDE_ERROR("invalid payload\n");
+		SDE_ERROR("invalid payload len %d exp %zd\n", hw_cfg->len,
+				sizeof(struct drm_msm_rc_mask_cfg));
 		return -EINVAL;
 	}