Skip to content

Commit d9aa657

Browse files
Kuogee Hsiehrobclark
authored andcommitted
drm/msm/dp: check sink_count before update is_connected status
Link status is different from display connected status in the case of something like an Apple dongle where the type-c plug can be connected, and therefore the link is connected, but no sink is connected until an HDMI cable is plugged into the dongle. The sink_count of DPCD of dongle will increase to 1 once an HDMI cable is plugged into the dongle so that display connected status will become true. This checking also apply at pm_resume. Changes in v4: -- none Fixes: 94e58e2 ("drm/msm/dp: reset dp controller only at boot up and pm_resume") Reported-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Tested-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org> Fixes: 8ede2ec ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets") Link: https://lore.kernel.org/r/1619048258-8717-2-git-send-email-khsieh@codeaurora.org Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 02ded13 commit d9aa657

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,8 @@ static int dp_connect_pending_timeout(struct dp_display_private *dp, u32 data)
586586
mutex_lock(&dp->event_mutex);
587587

588588
state = dp->hpd_state;
589-
if (state == ST_CONNECT_PENDING) {
590-
dp_display_enable(dp, 0);
589+
if (state == ST_CONNECT_PENDING)
591590
dp->hpd_state = ST_CONNECTED;
592-
}
593591

594592
mutex_unlock(&dp->event_mutex);
595593

@@ -669,10 +667,8 @@ static int dp_disconnect_pending_timeout(struct dp_display_private *dp, u32 data
669667
mutex_lock(&dp->event_mutex);
670668

671669
state = dp->hpd_state;
672-
if (state == ST_DISCONNECT_PENDING) {
673-
dp_display_disable(dp, 0);
670+
if (state == ST_DISCONNECT_PENDING)
674671
dp->hpd_state = ST_DISCONNECTED;
675-
}
676672

677673
mutex_unlock(&dp->event_mutex);
678674

@@ -1272,7 +1268,12 @@ static int dp_pm_resume(struct device *dev)
12721268

12731269
status = dp_catalog_link_is_connected(dp->catalog);
12741270

1275-
if (status)
1271+
/*
1272+
* can not declared display is connected unless
1273+
* HDMI cable is plugged in and sink_count of
1274+
* dongle become 1
1275+
*/
1276+
if (status && dp->link->sink_count)
12761277
dp->dp_display.is_connected = true;
12771278
else
12781279
dp->dp_display.is_connected = false;

0 commit comments

Comments
 (0)