From a5949c654b7ff37350e4b4ddbeb24755173070ee Mon Sep 17 00:00:00 2001 From: Lei Chen Date: Tue, 4 Apr 2023 13:54:20 +0800 Subject: [PATCH] disp: msm: add check for panel ROI alignment and DSC slice settings The height and width of ROI alignment must be integral multiple of DSC slice height and width. Add a check in partial update DT parsing function and disable patrial update when panel ROI alignment can't match DSC slice settings. Change-Id: Ib80ca1cde5041936f9525e19757e95ff5898137f Signed-off-by: Lei Chen --- msm/dsi/dsi_panel.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index b51319dfde..baf9f395bb 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -3255,15 +3255,21 @@ static int dsi_panel_parse_partial_update_caps(struct dsi_display_mode *mode, roi_caps->enabled = roi_caps->num_roi > 0; - DSI_DEBUG("partial update num_rois=%d enabled=%d\n", roi_caps->num_roi, - roi_caps->enabled); - if (roi_caps->enabled) rc = dsi_panel_parse_roi_alignment(utils, &roi_caps->align); if (rc) memset(roi_caps, 0, sizeof(*roi_caps)); + else if (mode->priv_info->dsc_enabled && + ((roi_caps->align.min_width % mode->priv_info->dsc.config.slice_width) || + (roi_caps->align.min_height % mode->priv_info->dsc.config.slice_height))) { + memset(roi_caps, 0, sizeof(*roi_caps)); + DSI_ERR("panel roi can't match DSC slice settings,disable partial update\n"); + } + + DSI_DEBUG("partial update num_rois=%d enabled=%d\n", roi_caps->num_roi, + roi_caps->enabled); return rc; }