aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0978-drm-amd-dal-remove-sink-from-MST-link.patch
blob: a1d250f43ddb30c417aa2aef115e202db33b4818 (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
52
53
54
55
56
57
58
59
60
61
62
From 22576c8eba11fe45a3fc27a19ea8a2cb23ffdaf1 Mon Sep 17 00:00:00 2001
From: Mykola Lysenko <Mykola.Lysenko@amd.com>
Date: Thu, 17 Dec 2015 19:19:08 +0800
Subject: [PATCH 0978/1050] drm/amd/dal: remove sink from MST link

When we remove MST display downstream, we should remove
sink during connector destruction.

Also do not report error if sink already removed from link.
This can happen in case of physical disconnect of mst branch.

Links will be removed in dc_link_detect. But fake removal in
MST connector destruction is not of harm, as sink not in
array already

Change-Id: I0a039230cbd645956d163cf9e369257486977516
Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com>
Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
---
 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c | 7 +++++--
 drivers/gpu/drm/amd/dal/dc/core/dc.c                    | 2 --
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c
index 39bf960..85fd17f 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -74,7 +74,8 @@ dm_dp_mst_detect(struct drm_connector *connector, bool force)
 			&master->mst_mgr,
 			aconnector->port);
 
-	if (status == connector_status_disconnected && aconnector->dc_sink) {
+	if (status == connector_status_disconnected && aconnector->edid) {
+		kfree(aconnector->edid);
 		aconnector->edid = NULL;
 	}
 
@@ -333,7 +334,9 @@ static void dm_dp_destroy_mst_connector(
 	drm_connector_cleanup(connector);
 	drm_modeset_unlock_all(dev);
 
-	kfree(connector);
+	dc_link_remove_sink(aconnector->dc_link, aconnector->dc_sink);
+
+	kfree(aconnector);
 	DRM_DEBUG_KMS("\n");
 }
 
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index a37cd87..4a75cb9 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -992,6 +992,4 @@ void dc_link_remove_sink(const struct dc_link *link, const struct dc_sink *sink)
 			return;
 		}
 	}
-
-	BREAK_TO_DEBUGGER();
 }
-- 
1.9.1