aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0850-drm-amd-dal-fix-bug-in-dc_link_remove_sink.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0850-drm-amd-dal-fix-bug-in-dc_link_remove_sink.patch')
-rw-r--r--common/recipes-kernel/linux/files/0850-drm-amd-dal-fix-bug-in-dc_link_remove_sink.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0850-drm-amd-dal-fix-bug-in-dc_link_remove_sink.patch b/common/recipes-kernel/linux/files/0850-drm-amd-dal-fix-bug-in-dc_link_remove_sink.patch
new file mode 100644
index 00000000..2f04741a
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0850-drm-amd-dal-fix-bug-in-dc_link_remove_sink.patch
@@ -0,0 +1,48 @@
+From 8d9b96cbce84b81e0ba23665bb16941f351f0416 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 0850/1050] drm/amd/dal: fix bug in dc_link_remove_sink
+
+Change-Id: Id6ba313382d503bcbdeaaaad51b181dd2ed8ca02
+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;
+--
+1.9.1
+