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
|
From 8dc55a87f0ee15ddf913a6e3e4e04c85ba86cebc Mon Sep 17 00:00:00 2001
From: Ken Chalmers <ken.chalmers@amd.com>
Date: Thu, 4 May 2017 13:34:55 -0400
Subject: [PATCH 0408/4131] drm/amd/display: Continue with stream enable if DP
link training fails.
Not necessarily a fatal problem - some monitors will recover and show
the stream anyway if link training fails.
Signed-off-by: Ken Chalmers <ken.chalmers@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_link.c | 21 +++++++++++++++++----
drivers/gpu/drm/amd/display/dc/inc/core_status.h | 1 +
2 files changed, 18 insertions(+), 4 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 5d374cb..ffc0eea 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1225,7 +1225,7 @@ static enum dc_status enable_link_dp(struct pipe_ctx *pipe_ctx)
status = DC_OK;
}
else
- status = DC_ERROR_UNEXPECTED;
+ status = DC_FAIL_DP_LINK_TRAINING;
enable_stream_features(pipe_ctx);
@@ -1833,9 +1833,22 @@ void core_link_enable_stream(struct pipe_ctx *pipe_ctx)
{
struct core_dc *core_dc = DC_TO_CORE(pipe_ctx->stream->ctx->dc);
- if (DC_OK != enable_link(pipe_ctx)) {
- BREAK_TO_DEBUGGER();
- return;
+ enum dc_status status = enable_link(pipe_ctx);
+
+ if (status != DC_OK) {
+ dm_logger_write(pipe_ctx->stream->ctx->logger,
+ LOG_WARNING, "enabling link %u failed: %d\n",
+ pipe_ctx->stream->sink->link->public.link_index,
+ status);
+
+ /* Abort stream enable *unless* the failure was due to
+ * DP link training - some DP monitors will recover and
+ * show the stream anyway.
+ */
+ if (status != DC_FAIL_DP_LINK_TRAINING) {
+ BREAK_TO_DEBUGGER();
+ return;
+ }
}
/* turn off otg test pattern if enable */
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_status.h b/drivers/gpu/drm/amd/display/dc/inc/core_status.h
index 128617d..b5759c0 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_status.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_status.h
@@ -41,6 +41,7 @@ enum dc_status {
DC_SURFACE_PIXEL_FORMAT_UNSUPPORTED = 11,
DC_FAIL_BANDWIDTH_VALIDATE = 12, /* BW and Watermark validation */
DC_FAIL_SCALING = 13,
+ DC_FAIL_DP_LINK_TRAINING = 14,
DC_ERROR_UNEXPECTED = -1
};
--
2.7.4
|