disp: msm: sde: disable RC in case of configuration mismatch

Currently when there is a modeset and usermode does not disable
or reprogram the RC mask, driver will compute an invalid configuration.

This change checks the RC mask with panel resolution and disables
RC HW internally if there is a mismatch.

Change-Id: I0e6afcf38cfc9165a6c0d2c12bfbc7b2b5f2ce65
Signed-off-by: Amine Najahi <quic_anajahi@quicinc.com>
This commit is contained in:
Amine Najahi
2022-10-13 10:04:54 -04:00
committed by Gerrit - the friendly Code Review server
parent abdb501164
commit 5b1d909312

View File

@@ -925,6 +925,7 @@ int sde_hw_rc_setup_mask(struct sde_hw_dspp *hw_dspp, void *cfg)
struct msm_roi_list *last_roi_list;
u32 merge_mode = 0;
bool roi_programmed = false;
u64 mask_w = 0, mask_h = 0, panel_w = 0, panel_h = 0;
if (!hw_dspp || !hw_cfg) {
SDE_ERROR("invalid arguments\n");
@@ -957,6 +958,19 @@ int sde_hw_rc_setup_mask(struct sde_hw_dspp *hw_dspp, void *cfg)
last_roi_list = RC_STATE(hw_dspp).last_roi_list;
roi_programmed = RC_STATE(hw_dspp).roi_programmed;
mask_w = rc_mask_cfg->width;
mask_h = rc_mask_cfg->height;
panel_w = hw_cfg->panel_width;
panel_h = hw_cfg->panel_height;
if ((panel_w != mask_w || panel_h != mask_h)) {
SDE_ERROR("RC-%d mask: w %d h %d panel: w %d h %d mismatch\n",
RC_IDX(hw_dspp), mask_w, mask_h, panel_w, panel_h);
SDE_EVT32(1);
_sde_hw_rc_reg_write(hw_dspp, SDE_HW_RC_REG1, 0);
return -EINVAL;
}
if (!roi_programmed) {
SDE_DEBUG("full frame update\n");
memset(&merged_roi, 0, sizeof(struct sde_rect));