[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250711-hpd-refactor-v1-5-33cbac823f34@oss.qualcomm.com>
Date: Fri, 11 Jul 2025 17:58:10 -0700
From: Jessica Zhang <jessica.zhang@....qualcomm.com>
To: Rob Clark <robin.clark@....qualcomm.com>,
Abhinav Kumar <abhinav.kumar@...ux.dev>,
Dmitry Baryshkov <lumag@...nel.org>, Sean Paul <sean@...rly.run>,
Marijn Suijten <marijn.suijten@...ainline.org>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Jessica Zhang <jessica.zhang@....qualcomm.com>
Cc: linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Yongxing Mou <quic_yongmou@...cinc.com>
Subject: [PATCH 05/19] drm/msm/dp: Replace ST_MAINLINK_READY with
link_ready in plug/hpd_irq handlers
The ST_MAINLINK_READY state and msm_dp::link_ready both indicate when
link training has been successfully completed and the link is ready to be
used.
Thus, replace ST_MAINLINK_READY checks with a check for
msm_dp::link_ready.
Signed-off-by: Jessica Zhang <jessica.zhang@....qualcomm.com>
---
drivers/gpu/drm/msm/dp/dp_display.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index f93fbcff2cda..af3cc32aa123 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -595,7 +595,7 @@ static int msm_dp_hpd_plug_handle(struct msm_dp_display_private *dp, u32 data)
drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n",
dp->msm_dp_display.connector_type, state);
- if (state == ST_MAINLINK_READY || state == ST_CONNECTED) {
+ if (dp->msm_dp_display.link_ready) {
mutex_unlock(&dp->event_mutex);
return 0;
}
@@ -677,7 +677,7 @@ static int msm_dp_hpd_unplug_handle(struct msm_dp_display_private *dp, u32 data)
} else if (state == ST_DISCONNECT_PENDING) {
mutex_unlock(&dp->event_mutex);
return 0;
- } else if (state == ST_MAINLINK_READY) {
+ } else if (state != ST_CONNECTED && dp->msm_dp_display.link_ready) {
msm_dp_ctrl_off_link(dp->ctrl);
msm_dp_display_host_phy_exit(dp);
dp->hpd_state = ST_DISCONNECTED;
@@ -723,8 +723,8 @@ static int msm_dp_irq_hpd_handle(struct msm_dp_display_private *dp, u32 data)
drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n",
dp->msm_dp_display.connector_type, state);
- if (state == ST_MAINLINK_READY || state == ST_DISCONNECT_PENDING) {
- /* wait until ST_CONNECTED */
+ if (dp->msm_dp_display.link_ready != dp->msm_dp_display.connected) {
+ /* wait until connect/disconnect handling is completed */
msm_dp_add_event(dp, EV_IRQ_HPD_INT, 0, 1); /* delay = 1 */
mutex_unlock(&dp->event_mutex);
return 0;
--
2.50.1
Powered by blists - more mailing lists