From 51de59d06b53cb72ee549fb7d396a0b7a3a65e97 Mon Sep 17 00:00:00 2001 From: Gopikrishnaiah Anandan Date: Wed, 25 Aug 2021 18:35:18 -0700 Subject: [PATCH] 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 --- include/uapi/display/drm/msm_drm_pp.h | 2 ++ msm/sde/sde_hw_rc.c | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/uapi/display/drm/msm_drm_pp.h b/include/uapi/display/drm/msm_drm_pp.h index 1be662c6ad..03b396544d 100644 --- a/include/uapi/display/drm/msm_drm_pp.h +++ b/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 diff --git a/msm/sde/sde_hw_rc.c b/msm/sde/sde_hw_rc.c index 4fa75372ce..31a127e66d 100644 --- a/msm/sde/sde_hw_rc.c +++ b/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; }