aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0543-drm-amd-dal-fix-bug-in-dc_link_remove_sink.patch
blob: eeb74f28be3e3471818b2e0da53cdd4460204edd (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
From 7e21aac36597382339dcd4ce4a0353b45601196e Mon Sep 17 00:00:00 2001
From: Mykola Lysenko <Mykola.Lysenko@amd.com>
Date: Tue, 1 Dec 2015 18:32:26 +0800
Subject: [PATCH 0543/1110] drm/amd/dal: fix bug in dc_link_remove_sink

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc.c | 8 ++++++++
 drivers/gpu/drm/amd/dal/dc/dc.h      | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index 60cbb47..fded924 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -847,6 +847,14 @@ void dc_link_remove_sink(struct dc_link *link, const struct dc_sink *sink)
 		if (link->sink[i] == sink) {
 			dc_sink_release(sink);
 			link->sink[i] = NULL;
+
+			/* shrink array to remove empty place */
+			dc_service_memmove(
+				&link->sink[i],
+				&link->sink[i + 1],
+				(link->sink_count - i - 1) *
+				sizeof(link->sink[i]));
+
 			link->sink_count--;
 			return;
 		}
diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h
index 77fa4c8..7b611d7 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc.h
@@ -270,7 +270,7 @@ void dc_update_stream(const struct dc_stream *dc_stream,
  * The currently active signal type (HDMI, DP-SST, DP-MST) is also reported.
  */
 struct dc_link {
-	const struct dc_sink *sink[MAX_SINKS_PER_LINK]; /* TODO: multiple sink support for MST */
+	const struct dc_sink *sink[MAX_SINKS_PER_LINK];
 	unsigned int sink_count;
 	enum dc_connection_type type;
 	enum signal_type connector_signal;
-- 
2.7.4