From 481be5c6c7aedc207f201d4b2a3a1425d5926f18 Mon Sep 17 00:00:00 2001 From: Anjaneya Prasad Musunuri Date: Thu, 22 Dec 2022 18:11:04 +0530 Subject: [PATCH 1/3] disp: msm: sde: clear cached rectangles when PU ROI is set clear cached rectangles when PU ROI is set to avoid incorrect cached rois when two subsequent state duplications occur due to timing. This will lead to commit N and commit N+1 to have same cached ROIs as commit N-1. This results in issues when commit N-1 is PU, N is full frame and N+1 is PU with same ROI as N-1. Mot-CRs-fixed: (CR) Change-Id: I3bb9390e500d327e703e41d64f7aaae5e5f1b4f2 Signed-off-by: Anjaneya Prasad Musunuri (cherry picked from commit 052cf4052e378589283700e6175281c160d02483) Reviewed-on: https://gerrit.mot.com/2807800 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Kauan da Silva Submit-Approved: Deise Alves Tested-by: Deise Alves Reviewed-by: Marcelo Pincinato --- msm/sde/sde_crtc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index 9caa41328e80..96952ce94d03 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -657,6 +657,7 @@ static int _sde_crtc_set_roi_v1(struct drm_crtc_state *state, crtc = cstate->base.crtc; memset(&cstate->user_roi_list, 0, sizeof(cstate->user_roi_list)); + memset(&cstate->cached_user_roi_list, 0, sizeof(cstate->cached_user_roi_list)); if (!usr_ptr) { SDE_DEBUG("crtc%d: rois cleared\n", DRMID(crtc)); From 59752ef8409bd9c04802761cae9a90b4609ca13a Mon Sep 17 00:00:00 2001 From: wangyq13 Date: Wed, 6 Dec 2023 11:53:07 +0800 Subject: [PATCH 2/3] msm/dsi_display: resend new roi to panel, fix pu dup issue dsi_display: Resend new roi to panel, workaround solution to fix pu duplicate issue. Change-Id: I1608b9198a13f8cbcc0ff651318e49adb0205d82 Signed-off-by: wangyq13 Reviewed-on: https://gerrit.mot.com/2815865 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Shanshan Dai Reviewed-by: Guobin Zhang Submit-Approved: Jira Key (cherry picked from commit 7171c24cb4c101c76b83083fa10b62d3c29ae0de) Reviewed-on: https://gerrit.mot.com/2818207 Reviewed-by: Yeqing Wang Reviewed-by: Carlos Pinho --- msm/dsi/dsi_display.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/msm/dsi/dsi_display.c b/msm/dsi/dsi_display.c index 0c6b2c40b866..0b00dfe5ae7f 100644 --- a/msm/dsi/dsi_display.c +++ b/msm/dsi/dsi_display.c @@ -8846,6 +8846,12 @@ static int dsi_display_set_roi(struct dsi_display *display, return rc; } + rc = dsi_panel_send_roi_dcs(display->panel, i, &ctrl_roi); + if (rc) { + DSI_ERR("dsi_panel_set_roi twice failed rc %d\n", rc); + return rc; + } + /* re-program the ctrl with the timing based on the new roi */ rc = dsi_ctrl_timing_setup(ctrl->ctrl); if (rc) { From 760ad20d37ae0e7dc14dcab0aec76587804f4064 Mon Sep 17 00:00:00 2001 From: Jinfeng Gu Date: Thu, 22 Aug 2024 15:51:37 +0800 Subject: [PATCH 3/3] disp: msm: dsi: add null pointer check in dsi_display_dev_remove This change add display null pointer check in dsi_display_dev_remove. Mot-CRs-fixed: (CR) CVE-Fixed: CVE-2024-53024 CRs-Fixed: QC-CR#3902182 Change-Id: Ib31756c3b22256d19cbcb508f60de4550e3834e1 Signed-off-by: Jinfeng Gu Signed-off-by: Vijeth Kumar K Reviewed-on: https://gerrit.mot.com/3168319 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Varun Shrivastava Reviewed-by: Guobin Zhang Submit-Approved: Jira Key --- msm/dsi/dsi_display.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/msm/dsi/dsi_display.c b/msm/dsi/dsi_display.c index 0b00dfe5ae7f..31a59b93fa9c 100644 --- a/msm/dsi/dsi_display.c +++ b/msm/dsi/dsi_display.c @@ -6762,6 +6762,10 @@ int dsi_display_dev_remove(struct platform_device *pdev) } display = platform_get_drvdata(pdev); + if (!display || !display->panel_node) { + DSI_ERR("invalid display\n"); + return -EINVAL; + } /* decrement ref count */ of_node_put(display->panel_node);