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
|
From 6313f91bdd2cc96c6b2b73c2c713a3e0a9599d2d Mon Sep 17 00:00:00 2001
From: Martin Tsai <martin.tsai@amd.com>
Date: Fri, 8 Sep 2017 19:25:35 +0800
Subject: [PATCH 2469/4131] drm/amd/display: To prevent detecting new sink from
spurious HPD
Signed-off-by: Martin Tsai <martin.tsai@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 | 33 ++++++++++++++++-----------
drivers/gpu/drm/amd/display/dc/dc_types.h | 1 +
2 files changed, 21 insertions(+), 13 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 d5eaebe..c7751a3 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -649,27 +649,34 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
sink_init_data.link = link;
sink_init_data.sink_signal = sink_caps.signal;
- if (link->local_sink) {
- sink = link->local_sink;
- } else {
- sink_init_data.link = link;
- sink_init_data.sink_signal = sink_caps.signal;
+ sink = dc_sink_create(&sink_init_data);
+ if (!sink) {
+ DC_ERROR("Failed to create sink!\n");
+ return false;
+ }
- sink = dc_sink_create(&sink_init_data);
- if (!sink) {
- DC_ERROR("Failed to create sink!\n");
- return false;
+ if (link->local_sink) {
+ edid_status = dm_helpers_read_local_edid(
+ link->ctx,
+ link,
+ sink);
+
+ 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;
- }
- 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:
@@ -762,7 +769,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
link->ctx,
link,
sink);
- if (edid_status != EDID_OK) {
+ 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;
diff --git a/drivers/gpu/drm/amd/display/dc/dc_types.h b/drivers/gpu/drm/amd/display/dc/dc_types.h
index 6b891fd..4bd74fc 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_types.h
@@ -151,6 +151,7 @@ enum dc_edid_status {
EDID_BAD_INPUT,
EDID_NO_RESPONSE,
EDID_BAD_CHECKSUM,
+ EDID_THE_SAME,
};
/* audio capability from EDID*/
--
2.7.4
|