aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0677-drm-amd-dal-Fix-issue-with-sink-being-added-to-link-.patch
blob: 3a669073842f9dc2950af152976194fa85364026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From c8a6b99b04833217438fd1bc18a6655ae96855e6 Mon Sep 17 00:00:00 2001
From: Anthony Koo <Anthony.Koo@amd.com>
Date: Thu, 7 Jan 2016 16:47:25 -0500
Subject: [PATCH 0677/1110] drm/amd/dal: Fix issue with sink being added to
 link on each dc_link_detect

In normal hotplug case, all sinks are removed from link on disconnect.
On connect, new sinks are added to link.

If there is force triggered detection, such as on S3 resume, there may be
existing sink when dc_link_detect is called. In this case, existing code
keeps adding more sinks to link.

This change assumes dc_link_detect will detect the correct new state and
add the new sinks properly.
So at the start of dc_link_detect, we should first detach all existing sinks.

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc_link.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
index 5e39a41..5f24ef1 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
@@ -571,6 +571,11 @@ void dc_link_detect(const struct dc_link *dc_link)
 		return;
 	}
 
+	/* Free existing state before doing detection on SST
+	 * TODO: For MST, need to investigate if the same is required. */
+	if (link->public.type != dc_connection_mst_branch)
+		link_disconnect_all_sinks(link);
+
 	if (new_connection_type != dc_connection_none) {
 		link->public.type = new_connection_type;
 
@@ -718,8 +723,6 @@ void dc_link_detect(const struct dc_link *dc_link)
 		/* From Connected-to-Disconnected. */
 		if (link->public.type == dc_connection_mst_branch)
 			dc_helpers_dp_mst_stop_top_mgr(link->ctx, &link->public);
-		else
-			link_disconnect_all_sinks(link);
 
 		link->public.type = dc_connection_none;
 		sink_caps.signal = SIGNAL_TYPE_NONE;
-- 
2.7.4