aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0997-drm-amd-dal-Dump-EDID-data-one-block-per-line.patch
blob: 2034aee6377f4207ac34b9230735e5ea3fe9a9ac (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
From 6cfd0ad4e3148a3480a90d38697a909cc8f048cf Mon Sep 17 00:00:00 2001
From: Yongqiang Sun <yongqiang.sun@amd.com>
Date: Fri, 1 Apr 2016 09:43:39 -0400
Subject: [PATCH 0997/1110] drm/amd/dal: Dump EDID data one block per line.

In case of EDID length is 384 bytes or more, it
exceeds maximum line number limit for printk.
Dump EDID data one block per line will solve the
issue.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c |  3 +++
 drivers/gpu/drm/amd/dal/dc/core/dc_link.c             | 10 ++++++----
 drivers/gpu/drm/amd/dal/dc/dc_types.h                 |  1 +
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c
index c6d6267..434fc5c 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_helpers.c
@@ -549,6 +549,9 @@ void dm_helper_conn_log(struct dc_context *ctx,
 		size--;
 	}
 
+	if (hex_data_count > (CONN_MAX_LINE_SIZE - size))
+		return;
+
 	if (hex_data) {
 		int i;
 
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
index 73dbf4f..4e57ed9 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
@@ -680,10 +680,12 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
 		}
 
 		/* Connectivity log: detection */
-		CONN_DATA_DETECT(link, sink->public.dc_edid.raw_edid,
-				sink->public.dc_edid.length,
-				"%s: ",
-				sink->public.edid_caps.display_name);
+		for (i = 0; i < sink->public.dc_edid.length / EDID_BLOCK_SIZE; i++) {
+			CONN_DATA_DETECT(link,
+					&sink->public.dc_edid.raw_edid[i * EDID_BLOCK_SIZE],
+					EDID_BLOCK_SIZE,
+					"%s: [Block %d] ", sink->public.edid_caps.display_name, i);
+		}
 
 		dal_logger_write(link->ctx->logger,
 			LOG_MAJOR_DETECTION,
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h
index 99da485..a375b00 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h
@@ -165,6 +165,7 @@ enum bool_param_shift {
 };
 
 #define MAX_EDID_BUFFER_SIZE 512
+#define EDID_BLOCK_SIZE 128
 #define MAX_SURFACE_NUM 2
 #define NUM_PIXEL_FORMATS 10
 
-- 
2.7.4