From a457a0ada9f59fab196900cac2a91331e51bed6a Mon Sep 17 00:00:00 2001 From: Sankeerth Billakanti Date: Fri, 3 Apr 2020 17:40:10 +0530 Subject: [PATCH 1/3] disp: msm: dp: set ctrl power_on flag when link clock is on While running DP simulation script for stability and the rare occasions when link clock fails to enable, the ctrl power_on flag is wrongly set indicating the link is powered on. This flag is used in the ctrl sub-module to check that the link clock is on before accessing the registers powered by the link clock. When this flag is wrongly set, the link registers are accessed while processing the cable disconnect to cause a NOC error. The change will ensure the power_on flag is set when the link clock is on so that the access to registers in the link clock domain can be correctly filtered by the power_on flag. Change-Id: I40af054a5738172f5ea86079a9258518f8fdd44e Signed-off-by: Sankeerth Billakanti Signed-off-by: Tatenda Chipeperekwa --- msm/dp/dp_ctrl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/msm/dp/dp_ctrl.c b/msm/dp/dp_ctrl.c index 19445de21d..3f69f235ad 100644 --- a/msm/dp/dp_ctrl.c +++ b/msm/dp/dp_ctrl.c @@ -723,8 +723,10 @@ static int dp_ctrl_link_setup(struct dp_ctrl_private *ctrl, bool shallow) break; } - if (!link_train_max_retries || atomic_read(&ctrl->aborted)) + if (!link_train_max_retries || atomic_read(&ctrl->aborted)) { + dp_ctrl_disable_link_clock(ctrl); break; + } if (rc != -EAGAIN) dp_ctrl_link_rate_down_shift(ctrl); @@ -1319,7 +1321,8 @@ static int dp_ctrl_on(struct dp_ctrl *dp_ctrl, bool mst_mode, ctrl->initial_bw_code = ctrl->link->link_params.bw_code; rc = dp_ctrl_link_setup(ctrl, shallow); - ctrl->power_on = true; + if (!rc) + ctrl->power_on = true; end: return rc; } From ba8d20f98ecd115623eac3115ff520c2293aaa40 Mon Sep 17 00:00:00 2001 From: Sankeerth Billakanti Date: Thu, 14 May 2020 19:58:01 +0530 Subject: [PATCH 2/3] disp: msm: dp: avoid register access when lclk is off Sometimes the link clock is not getting locked when dp display is resumed from PM suspend. This is causing NOC error when registers in link clock domain are accessed without proper checks. The set_colorspace, config_hdr and update_pps connector ops are accessing the registers in link clock domain without checking if the necessary clocks are enabled. These changes will ensure the DP stream clocks are not enabled when link clock enable fails and prevents the connector ops from accessing the registers whose clocks are not enabled. Change-Id: If89d2552ee0ce96493ee8c1666d7677221705d9a Signed-off-by: Sankeerth Billakanti Signed-off-by: Tatenda Chipeperekwa --- msm/dp/dp_display.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index 487c63fed2..4448e06791 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -2646,6 +2646,11 @@ static int dp_display_config_hdr(struct dp_display *dp_display, void *panel, return -EINVAL; } + if (!dp_display_state_is(DP_STATE_ENABLED)) { + dp_display_state_show("[not enabled]"); + return 0; + } + /* * In rare cases where HDR metadata is updated independently * flush the HDR metadata immediately instead of relying on @@ -2667,12 +2672,20 @@ static int dp_display_setup_colospace(struct dp_display *dp_display, u32 colorspace) { struct dp_panel *dp_panel; + struct dp_display_private *dp; if (!dp_display || !panel) { pr_err("invalid input\n"); return -EINVAL; } + dp = container_of(dp_display, struct dp_display_private, dp_display); + + if (!dp_display_state_is(DP_STATE_ENABLED)) { + dp_display_state_show("[not enabled]"); + return 0; + } + dp_panel = panel; return dp_panel->set_colorspace(dp_panel, colorspace); @@ -3005,6 +3018,11 @@ static int dp_display_update_pps(struct dp_display *dp_display, return -EINVAL; } + if (!dp_display_state_is(DP_STATE_ENABLED)) { + dp_display_state_show("[not enabled]"); + return 0; + } + dp_panel = sde_conn->drv_panel; dp_panel->update_pps(dp_panel, pps_cmd); return 0; From 7424c2352d16c366e69e267f4881f7aaca96206b Mon Sep 17 00:00:00 2001 From: Sankeerth Billakanti Date: Tue, 14 Apr 2020 00:05:31 +0530 Subject: [PATCH 3/3] disp: msm: dp: clear notification states for dp mst If a DP MST display is connected after a DP SST unplug, the DISCONNECT_NOTIFIED state is not cleared and CONNECT_NOTIFIED state is not set. These states are not relevant for DP MST and hence skipped during the send_notification. But the DISCONNECT_NOTIFIED state that was not cleared from the previous SST unplug will prevent the wait for completion when DP MST is disconnected. This will trigger the host_unready to get executed before the dp_display_disable happens for the DP MST displays. As the result, the dp_display_disable exits early causing all the stream clocks and the panels objects to remain active even after unplug. As CONNECT_NOTIFIED and DISCONNECT_NOTIFIED state are not relevant for DP MST, clearing them if DP MST hpd detected in dp_display. Change-Id: Iaf0e762633eb276e96cb860fda480adb04718eb9 Signed-off-by: Sankeerth Billakanti Signed-off-by: Tatenda Chipeperekwa --- msm/dp/dp_display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index 4448e06791..be5c7edcac 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -723,6 +723,7 @@ static void dp_display_send_hpd_event(struct dp_display_private *dp) if (dp->mst.mst_active) { DP_DEBUG("skip notification for mst mode\n"); + dp_display_state_remove(DP_STATE_DISCONNECT_NOTIFIED); return; }