aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0585-drm-amd-dal-Clean-up-aux-access-layer-in-DM.patch
blob: 8be6706abc0892afd7375f1d667eeddd35ff483a (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
From 028c8faa6f36780fa082a5eb2ded31b7ecde8dba Mon Sep 17 00:00:00 2001
From: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Date: Tue, 8 Dec 2015 13:08:49 -0500
Subject: [PATCH 0585/1110] drm/amd/dal: Clean up aux access layer in DM

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c | 6 ++++--
 drivers/gpu/drm/amd/dal/dc/core/dc.c                  | 3 +--
 drivers/gpu/drm/amd/dal/dc/core/dc_link_hwss.c        | 8 ++++++--
 drivers/gpu/drm/amd/dal/dc/dc.h                       | 2 +-
 drivers/gpu/drm/amd/dal/dc/dc_helpers.h               | 8 ++++++++
 5 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
index 7d3b2d3..b388dee 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dc_helpers.c
@@ -460,6 +460,7 @@ void dc_helpers_dp_mst_stop_top_mgr(
 
 bool dc_helper_dp_read_dpcd(
 		struct dc_context *ctx,
+		uint8_t link_index,
 		const struct dc_link *link,
 		uint32_t address,
 		uint8_t *data,
@@ -481,6 +482,7 @@ bool dc_helper_dp_read_dpcd(
 
 bool dc_helper_dp_write_dpcd(
 		struct dc_context *ctx,
+		uint8_t link_index,
 		const struct dc_link *link,
 		uint32_t address,
 		const uint8_t *data,
@@ -495,6 +497,6 @@ bool dc_helper_dp_write_dpcd(
 		return false;
 	}
 
-	return drm_dp_dpcd_write(&aconnector->dm_dp_aux.aux, address,
-			(uint8_t *)data, size) > 0;
+	return drm_dp_dpcd_write(&aconnector->dm_dp_aux.aux,
+			address, (uint8_t *)data, size) > 0;
 }
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index d8c0799..feda859 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -914,7 +914,6 @@ void dc_print_sync_report(
 	 * data from Step 1). */
 }
 
-/*AG TODO Create callbacks for WIN DM */
 bool dc_read_dpcd(
 		struct dc *dc,
 		uint32_t link_index,
@@ -937,7 +936,7 @@ bool dc_write_dpcd(
 		struct dc *dc,
 		uint32_t link_index,
 		uint32_t address,
-		uint8_t *data,
+		const uint8_t *data,
 		uint32_t size)
 {
 	struct core_link *link =
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link_hwss.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link_hwss.c
index 3a80a10..91aec82 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link_hwss.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link_hwss.c
@@ -21,7 +21,9 @@ enum dc_status core_link_read_dpcd(
 	uint32_t size)
 {
 	if (!dc_helper_dp_read_dpcd(link->ctx,
-			&link->public, address, data, size))
+			link->link_index,
+			&link->public,
+			address, data, size))
 			return DC_ERROR_UNEXPECTED;
 
 	return DC_OK;
@@ -34,7 +36,9 @@ enum dc_status core_link_write_dpcd(
 	uint32_t size)
 {
 	if (!dc_helper_dp_write_dpcd(link->ctx,
-			&link->public, address, data, size))
+			link->link_index,
+			&link->public,
+			address, data, size))
 				return DC_ERROR_UNEXPECTED;
 
 	return DC_OK;
diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h
index df76992..fa2712c 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc.h
@@ -436,7 +436,7 @@ bool dc_write_dpcd(
 		struct dc *dc,
 		uint32_t link_index,
 		uint32_t address,
-		uint8_t *data,
+		const uint8_t *data,
 	uint32_t size);
 
 #endif /* DC_INTERFACE_H_ */
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_helpers.h b/drivers/gpu/drm/amd/dal/dc/dc_helpers.h
index 66f4d2d..fe76833 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_helpers.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_helpers.h
@@ -72,15 +72,23 @@ void dc_helpers_dp_mst_stop_top_mgr(
 		struct dc_context *ctx,
 		const struct dc_link *link);
 
+/**
+ * OS specific aux read callback.
+ */
 bool dc_helper_dp_read_dpcd(
 		struct dc_context *ctx,
+		uint8_t link_index,
 		const struct dc_link *link,
 		uint32_t address,
 		uint8_t *data,
 		uint32_t size);
 
+/**
+ * OS specific aux write callback.
+ */
 bool dc_helper_dp_write_dpcd(
 		struct dc_context *ctx,
+		uint8_t link_index,
 		const struct dc_link *link,
 		uint32_t address,
 		const uint8_t *data,
-- 
2.7.4