aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0727-drm-amd-dal-Split-encoder_types-into-link-and-stream.patch
blob: 3c0f2702bc0f147a6ed433f663b49c00e1ec15d9 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
From ab0ebdeda2007e1f288f3585f1e0e227034f8840 Mon Sep 17 00:00:00 2001
From: Jordan Lazare <Jordan.Lazare@amd.com>
Date: Fri, 22 Jan 2016 15:43:46 -0500
Subject: [PATCH 0727/1110] drm/amd/dal: Split encoder_types into link and
 stream

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/inc/core_types.h        |   5 +-
 drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h     | 129 ---------------------
 drivers/gpu/drm/amd/dal/dc/inc/link_encoder.h      |  55 ++++++++-
 drivers/gpu/drm/amd/dal/dc/inc/stream_encoder.h    |  39 ++++++-
 .../gpu/drm/amd/dal/include/bios_parser_types.h    |   1 +
 drivers/gpu/drm/amd/dal/include/signal_types.h     |   2 +
 6 files changed, 97 insertions(+), 134 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h

diff --git a/drivers/gpu/drm/amd/dal/dc/inc/core_types.h b/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
index 1597b33..b0654ca 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
@@ -64,9 +64,12 @@ void enable_surface_flip_reporting(struct dc_surface *dc_surface,
 
 /********* core_stream ************/
 #include "grph_object_id.h"
-#include "encoder_types.h"
+#include "link_encoder.h"
+#include "stream_encoder.h"
 #include "clock_source_interface.h"
 #include "audio_interface.h"
+#include "scaler_types.h"
+#include "hw_sequencer_types.h"
 
 #define DC_STREAM_TO_CORE(dc_stream) container_of( \
 	dc_stream, struct core_stream, public)
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h b/drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h
deleted file mode 100644
index 7f3b9ad..0000000
--- a/drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2012-15 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: AMD
- *
- */
-
-#ifndef __DAL_ENCODER_TYPES_H__
-#define __DAL_ENCODER_TYPES_H__
-
-#include "grph_object_defs.h"
-#include "signal_types.h"
-#include "hw_sequencer_types.h"
-#include "link_service_types.h"
-
-struct encoder_init_data {
-	struct adapter_service *adapter_service;
-	enum channel_id channel;
-	struct graphics_object_id connector;
-	enum hpd_source_id hpd_source;
-	/* TODO: in DAL2, here was pointer to EventManagerInterface */
-	struct graphics_object_id encoder;
-	struct dc_context *ctx;
-	enum transmitter transmitter;
-};
-
-struct encoder_context {
-	/*
-	 * HW programming context
-	 */
-	/* DIG id. Also used as AC context */
-	enum engine_id engine;
-	/* DDC line */
-	enum channel_id channel;
-	/* HPD line */
-	enum hpd_source_id hpd_source;
-	/*
-	 * ASIC Control (VBIOS) context
-	 */
-	/* encoder output signal */
-	enum signal_type signal;
-	/* native connector id */
-	struct graphics_object_id connector;
-	/* downstream object (can be connector or downstream encoder) */
-	struct graphics_object_id downstream;
-};
-
-struct encoder_info_packet {
-	bool valid;
-	uint8_t hb0;
-	uint8_t hb1;
-	uint8_t hb2;
-	uint8_t hb3;
-	uint8_t sb[28];
-};
-
-struct encoder_info_frame {
-	/* auxiliary video information */
-	struct encoder_info_packet avi;
-	struct encoder_info_packet gamut;
-	struct encoder_info_packet vendor;
-	/* source product description */
-	struct encoder_info_packet spd;
-	/* video stream configuration */
-	struct encoder_info_packet vsc;
-};
-
-struct encoder_unblank_param {
-	struct hw_crtc_timing crtc_timing;
-	struct link_settings link_settings;
-};
-
-struct encoder_set_dp_phy_pattern_param {
-	enum dp_test_pattern dp_phy_pattern;
-	const uint8_t *custom_pattern;
-	uint32_t custom_pattern_size;
-	enum dp_panel_mode dp_panel_mode;
-};
-
-struct encoder_feature_support {
-	union {
-		struct {
-			/* 1 - external encoder; 0 - internal encoder */
-			uint32_t EXTERNAL_ENCODER:1;
-			uint32_t ANALOG_ENCODER:1;
-			uint32_t STEREO_SYNC:1;
-			/* check the DDC data pin
-			 * when performing DP Sink detection */
-			uint32_t DP_SINK_DETECT_POLL_DATA_PIN:1;
-			/* CPLIB authentication
-			 * for external DP chip supported */
-			uint32_t CPLIB_DP_AUTHENTICATION:1;
-			uint32_t IS_HBR2_CAPABLE:1;
-			uint32_t IS_HBR2_VALIDATED:1;
-			uint32_t IS_TPS3_CAPABLE:1;
-			uint32_t IS_AUDIO_CAPABLE:1;
-			uint32_t IS_VCE_SUPPORTED:1;
-			uint32_t IS_CONVERTER:1;
-			uint32_t IS_Y_ONLY_CAPABLE:1;
-			uint32_t IS_YCBCR_CAPABLE:1;
-		} bits;
-		uint32_t raw;
-	} flags;
-	/* maximum supported deep color depth */
-	enum dc_color_depth max_deep_color;
-	/* maximum supported clock */
-	uint32_t max_pixel_clock;
-};
-
-#endif
-
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/link_encoder.h b/drivers/gpu/drm/amd/dal/dc/inc/link_encoder.h
index 23920e1..df9019a 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/link_encoder.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/link_encoder.h
@@ -8,8 +8,59 @@
 #ifndef LINK_ENCODER_H_
 #define LINK_ENCODER_H_
 
-#include "core_types.h"
-#include "encoder_types.h"
+#include "dal_services_types.h"
+#include "grph_object_defs.h"
+#include "signal_types.h"
+#include "dc_types.h"
+
+struct dc_context;
+struct adapter_service;
+struct encoder_set_dp_phy_pattern_param;
+struct link_mst_stream_allocation_table;
+struct link_settings;
+struct link_training_settings;
+struct core_stream;
+
+struct encoder_init_data {
+	struct adapter_service *adapter_service;
+	enum channel_id channel;
+	struct graphics_object_id connector;
+	enum hpd_source_id hpd_source;
+	/* TODO: in DAL2, here was pointer to EventManagerInterface */
+	struct graphics_object_id encoder;
+	struct dc_context *ctx;
+	enum transmitter transmitter;
+};
+
+struct encoder_feature_support {
+	union {
+		struct {
+			/* 1 - external encoder; 0 - internal encoder */
+			uint32_t EXTERNAL_ENCODER:1;
+			uint32_t ANALOG_ENCODER:1;
+			uint32_t STEREO_SYNC:1;
+			/* check the DDC data pin
+			 * when performing DP Sink detection */
+			uint32_t DP_SINK_DETECT_POLL_DATA_PIN:1;
+			/* CPLIB authentication
+			 * for external DP chip supported */
+			uint32_t CPLIB_DP_AUTHENTICATION:1;
+			uint32_t IS_HBR2_CAPABLE:1;
+			uint32_t IS_HBR2_VALIDATED:1;
+			uint32_t IS_TPS3_CAPABLE:1;
+			uint32_t IS_AUDIO_CAPABLE:1;
+			uint32_t IS_VCE_SUPPORTED:1;
+			uint32_t IS_CONVERTER:1;
+			uint32_t IS_Y_ONLY_CAPABLE:1;
+			uint32_t IS_YCBCR_CAPABLE:1;
+		} bits;
+		uint32_t raw;
+	} flags;
+	/* maximum supported deep color depth */
+	enum dc_color_depth max_deep_color;
+	/* maximum supported clock */
+	uint32_t max_pixel_clock;
+};
 
 struct link_enc_status {
 	int dummy; /*TODO*/
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/stream_encoder.h b/drivers/gpu/drm/amd/dal/dc/inc/stream_encoder.h
index 3de1f80..6bb1d00 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/stream_encoder.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/stream_encoder.h
@@ -6,10 +6,45 @@
 #ifndef STREAM_ENCODER_H_
 #define STREAM_ENCODER_H_
 
-#include "encoder_types.h"
-#include "include/bios_parser_interface.h"
+#include "include/hw_sequencer_types.h"
 
 struct dc_bios;
+struct dc_context;
+struct dc_crtc_timing;
+
+
+struct encoder_info_packet {
+	bool valid;
+	uint8_t hb0;
+	uint8_t hb1;
+	uint8_t hb2;
+	uint8_t hb3;
+	uint8_t sb[28];
+};
+
+struct encoder_info_frame {
+	/* auxiliary video information */
+	struct encoder_info_packet avi;
+	struct encoder_info_packet gamut;
+	struct encoder_info_packet vendor;
+	/* source product description */
+	struct encoder_info_packet spd;
+	/* video stream configuration */
+	struct encoder_info_packet vsc;
+};
+
+struct encoder_unblank_param {
+	struct hw_crtc_timing crtc_timing;
+	struct link_settings link_settings;
+};
+
+struct encoder_set_dp_phy_pattern_param {
+	enum dp_test_pattern dp_phy_pattern;
+	const uint8_t *custom_pattern;
+	uint32_t custom_pattern_size;
+	enum dp_panel_mode dp_panel_mode;
+};
+
 
 struct stream_encoder {
 	struct stream_encoder_funcs *funcs;
diff --git a/drivers/gpu/drm/amd/dal/include/bios_parser_types.h b/drivers/gpu/drm/amd/dal/include/bios_parser_types.h
index b4b93c6..6f72e25 100644
--- a/drivers/gpu/drm/amd/dal/include/bios_parser_types.h
+++ b/drivers/gpu/drm/amd/dal/include/bios_parser_types.h
@@ -30,6 +30,7 @@
 #include "include/grph_object_ctrl_defs.h"
 #include "include/gpio_types.h"
 #include "include/adapter_service_types.h" /* for as_signal_type */
+#include "include/link_service_types.h"
 
 enum bp_result {
 	BP_RESULT_OK = 0, /* There was no error */
diff --git a/drivers/gpu/drm/amd/dal/include/signal_types.h b/drivers/gpu/drm/amd/dal/include/signal_types.h
index a50f7ed..827c316 100644
--- a/drivers/gpu/drm/amd/dal/include/signal_types.h
+++ b/drivers/gpu/drm/amd/dal/include/signal_types.h
@@ -26,6 +26,8 @@
 #ifndef __DC_SIGNAL_TYPES_H__
 #define __DC_SIGNAL_TYPES_H__
 
+#include "dal_services_types.h"
+
 enum signal_type {
 	SIGNAL_TYPE_NONE		= 0L,		/* no signal */
 	SIGNAL_TYPE_DVI_SINGLE_LINK	= (1 << 0),
-- 
2.7.4