aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2509-drm-amd-display-disconnect-on-HPD-low-even-if-edid-i.patch
blob: 5ada761d64eeb0252eb5aa862eda8082b8d8ccb0 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
From 70c8d7b4a0899c1ccb029b7a68bda9abe696d0f2 Mon Sep 17 00:00:00 2001
From: Wenjing Liu <Wenjing.Liu@amd.com>
Date: Mon, 25 Sep 2017 14:53:14 -0400
Subject: [PATCH 2509/4131] drm/amd/display: disconnect on HPD low even if edid
 is the same

[Description]
There are many occasions we need to retrieve sink capability and
notify connectivity change to os even if edid is not changed
on a HPD toggle.
(HDMI2.0 display needs re-enable link on every hpd,
display changes other capability outside from edid
 need to be queried again and possibly reset the mode, etc.)

In these cases we cannot keep the same sink without letting DM know.

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 42 ++++++---------------------
 1 file changed, 9 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index feb10be..e414e47 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -566,6 +566,8 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 			link->local_sink)
 		return true;
 
+	link_disconnect_sink(link);
+
 	if (new_connection_type != dc_connection_none) {
 		link->type = new_connection_type;
 
@@ -656,28 +658,15 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 			return false;
 		}
 
-		if (link->local_sink) {
-			edid_status = dm_helpers_read_local_edid(
-				link->ctx,
-				link,
-				sink);
+		sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock;
+		sink->converter_disable_audio = converter_disable_audio;
 
-			if (edid_status == EDID_OK) {
-				// Edid is not the same, to update the local sink with new sink.
-				sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock;
-				sink->converter_disable_audio = converter_disable_audio;
-				link->local_sink = sink;
-			}
-		} else {
-			sink->dongle_max_pix_clk = sink_caps.max_hdmi_pixel_clock;
-			sink->converter_disable_audio = converter_disable_audio;
-			link->local_sink = sink;
+		link->local_sink = sink;
 
-			edid_status = dm_helpers_read_local_edid(
+		edid_status = dm_helpers_read_local_edid(
 				link->ctx,
 				link,
 				sink);
-		}
 
 		switch (edid_status) {
 		case EDID_BAD_CHECKSUM:
@@ -758,28 +747,15 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 		if (link->type == dc_connection_mst_branch) {
 			LINK_INFO("link=%d, mst branch is now Disconnected\n",
 				link->link_index);
+
 			dm_helpers_dp_mst_stop_top_mgr(link->ctx, link);
 
 			link->mst_stream_alloc_table.stream_count = 0;
 			memset(link->mst_stream_alloc_table.stream_allocations, 0, sizeof(link->mst_stream_alloc_table.stream_allocations));
 		}
 
-		if (link->local_sink) {
-			sink = link->local_sink;
-			edid_status = dm_helpers_read_local_edid(
-						link->ctx,
-						link,
-						sink);
-			if (edid_status != EDID_OK && edid_status != EDID_THE_SAME) {
-				link_disconnect_sink(link);
-				link->type = dc_connection_none;
-				sink_caps.signal = SIGNAL_TYPE_NONE;
-			}
-		} else {
-			link_disconnect_sink(link);
-			link->type = dc_connection_none;
-			sink_caps.signal = SIGNAL_TYPE_NONE;
-		}
+		link->type = dc_connection_none;
+		sink_caps.signal = SIGNAL_TYPE_NONE;
 	}
 
 	LINK_INFO("link=%d, dc_sink_in=%p is now %s\n",
-- 
2.7.4