summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-03-31 01:36:12 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-03-31 01:36:12 +0000
commitc9e42a8cbb0fb67ec407784866285efd72afd071 (patch)
treec037aa77e4488087e1bfd21c757f7950d5cec4dd
parentfa485461a7a052e2de341395cd38349682677050 (diff)
drm/amd/display: Fix DP MST sinks removal issue
From Cruise Hung ee9caccc5e5cc1092baf6fb645525bba668b01c1 in linux-6.1.y/6.1.22 cbd6c1b17d3b42b7935526a86ad5f66838767d03 in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/display/dc/core/dc_link.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/core/dc_link.c b/sys/dev/pci/drm/amd/display/dc/core/dc_link.c
index 5edcc9b63ce..444a9999f6d 100644
--- a/sys/dev/pci/drm/amd/display/dc/core/dc_link.c
+++ b/sys/dev/pci/drm/amd/display/dc/core/dc_link.c
@@ -1016,6 +1016,7 @@ static bool detect_link_and_local_sink(struct dc_link *link,
struct dc_sink *prev_sink = NULL;
struct dpcd_caps prev_dpcd_caps;
enum dc_connection_type new_connection_type = dc_connection_none;
+ enum dc_connection_type pre_connection_type = link->type;
const uint32_t post_oui_delay = 30; // 30ms
DC_LOGGER_INIT(link->ctx->logger);
@@ -1118,6 +1119,8 @@ static bool detect_link_and_local_sink(struct dc_link *link,
}
if (!detect_dp(link, &sink_caps, reason)) {
+ link->type = pre_connection_type;
+
if (prev_sink)
dc_sink_release(prev_sink);
return false;
@@ -1349,6 +1352,8 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
bool is_delegated_to_mst_top_mgr = false;
enum dc_connection_type pre_link_type = link->type;
+ DC_LOGGER_INIT(link->ctx->logger);
+
is_local_sink_detect_success = detect_link_and_local_sink(link, reason);
if (is_local_sink_detect_success && link->local_sink)
@@ -1359,6 +1364,10 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
link->dpcd_caps.is_mst_capable)
is_delegated_to_mst_top_mgr = discover_dp_mst_topology(link, reason);
+ DC_LOG_DC("%s: link_index=%d is_local_sink_detect_success=%d pre_link_type=%d link_type=%d\n", __func__,
+ link->link_index, is_local_sink_detect_success, pre_link_type, link->type);
+
+
if (is_local_sink_detect_success &&
pre_link_type == dc_connection_mst_branch &&
link->type != dc_connection_mst_branch)