aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0721-drm-amd-dal-Clean-up-encoder_types.patch
blob: ac0df675626f06de4f27b456258b01d9bfeb0163 (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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
From e7a65721f0c60083acca9fb17486f30e5ac3a776 Mon Sep 17 00:00:00 2001
From: Jordan Lazare <Jordan.Lazare@amd.com>
Date: Thu, 21 Jan 2016 17:28:30 -0500
Subject: [PATCH 0721/1110] drm/amd/dal: Clean up encoder_types

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/dc_types.h           |   1 +
 drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h  | 129 ++++++++++++++
 drivers/gpu/drm/amd/dal/dc/inc/link_encoder.h   |   2 +-
 drivers/gpu/drm/amd/dal/dc/inc/stream_encoder.h |   2 +-
 drivers/gpu/drm/amd/dal/dc/irq_types.h          |   2 +
 drivers/gpu/drm/amd/dal/include/dal_types.h     |   1 +
 drivers/gpu/drm/amd/dal/include/encoder_types.h | 226 ------------------------
 drivers/gpu/drm/amd/dal/include/fixed31_32.h    |   2 +
 drivers/gpu/drm/amd/dal/include/fixed32_32.h    |   3 +
 9 files changed, 140 insertions(+), 228 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h
 delete mode 100644 drivers/gpu/drm/amd/dal/include/encoder_types.h

diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h
index 1834fe0..b932ec1 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h
@@ -25,6 +25,7 @@
 #ifndef DC_TYPES_H_
 #define DC_TYPES_H_
 
+#include "dal_services_types.h"
 #include "fixed32_32.h"
 #include "fixed31_32.h"
 #include "irq_types.h"
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h b/drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h
new file mode 100644
index 0000000..7f3b9ad
--- /dev/null
+++ b/drivers/gpu/drm/amd/dal/dc/inc/encoder_types.h
@@ -0,0 +1,129 @@
+/*
+ * 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 95defa8..23920e1 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,8 @@
 #ifndef LINK_ENCODER_H_
 #define LINK_ENCODER_H_
 
-#include "include/encoder_types.h"
 #include "core_types.h"
+#include "encoder_types.h"
 
 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 9665356..3de1f80 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/stream_encoder.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/stream_encoder.h
@@ -6,7 +6,7 @@
 #ifndef STREAM_ENCODER_H_
 #define STREAM_ENCODER_H_
 
-#include "include/encoder_types.h"
+#include "encoder_types.h"
 #include "include/bios_parser_interface.h"
 
 struct dc_bios;
diff --git a/drivers/gpu/drm/amd/dal/dc/irq_types.h b/drivers/gpu/drm/amd/dal/dc/irq_types.h
index 35a0991..f8f2395 100644
--- a/drivers/gpu/drm/amd/dal/dc/irq_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/irq_types.h
@@ -26,6 +26,8 @@
 #ifndef __DAL_IRQ_TYPES_H__
 #define __DAL_IRQ_TYPES_H__
 
+#include "dal_services_types.h"
+
 struct dc_context;
 
 typedef void (*interrupt_handler)(void *);
diff --git a/drivers/gpu/drm/amd/dal/include/dal_types.h b/drivers/gpu/drm/amd/dal/include/dal_types.h
index 0e16ebb..77bd09b 100644
--- a/drivers/gpu/drm/amd/dal/include/dal_types.h
+++ b/drivers/gpu/drm/amd/dal/include/dal_types.h
@@ -26,6 +26,7 @@
 #ifndef __DAL_TYPES_H__
 #define __DAL_TYPES_H__
 
+#include "dal_services_types.h"
 #include "signal_types.h"
 #include "dc_types.h"
 
diff --git a/drivers/gpu/drm/amd/dal/include/encoder_types.h b/drivers/gpu/drm/amd/dal/include/encoder_types.h
deleted file mode 100644
index 6a7b317..0000000
--- a/drivers/gpu/drm/amd/dal/include/encoder_types.h
+++ /dev/null
@@ -1,226 +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;
-};
-
-union encoder_flags {
-	struct {
-		/* enable audio (DP/eDP only) */
-		uint32_t ENABLE_AUDIO:1;
-		/* coherency */
-		uint32_t COHERENT:1;
-		/* delay after Pixel Format change before enable transmitter */
-		uint32_t DELAY_AFTER_PIXEL_FORMAT_CHANGE:1;
-		/* by default, do not turn off VCC when disabling output */
-		uint32_t TURN_OFF_VCC:1;
-		/* by default, do wait for HPD low after turn of panel VCC */
-		uint32_t NO_WAIT_FOR_HPD_LOW:1;
-		/* slow DP panels don't reset internal fifo */
-		uint32_t VID_STREAM_DIFFER_TO_SYNC:1;
-	} bits;
-	uint32_t raw;
-};
-
-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_info_frame_param {
-	struct encoder_info_frame packets;
-	struct encoder_context enc_ctx;
-};
-
-/*TODO: cleanup pending encoder cleanup*/
-struct encoder_output {
-	/* encoder AC & HW programming context */
-	struct encoder_context enc_ctx;
-	/* requested timing */
-	struct hw_crtc_timing crtc_timing;
-	/* clock source id (PLL or external) */
-	enum clock_source_id clock_source;
-	/* link settings (DP/eDP only) */
-	struct link_settings link_settings;
-	/* info frame packets */
-	struct encoder_info_frame info_frame;
-	/* timing validation (HDMI only) */
-	uint32_t max_tmds_clk_from_edid_in_mhz;
-	/* edp panel mode */
-	enum dp_panel_mode dp_panel_mode;
-	/* delay in milliseconds after powering up DP receiver (DP/eDP only) */
-	uint32_t delay_after_dp_receiver_power_up;
-	/* various flags for features and workarounds */
-	union encoder_flags flags;
-	/* delay after pixel format change */
-	uint32_t delay_after_pixel_format_change;
-	/* controller id */
-	enum controller_id controller;
-	/* maximum supported deep color depth for HDMI */
-	enum dc_color_depth max_hdmi_deep_color;
-	/* maximum supported pixel clock for HDMI */
-	uint32_t max_hdmi_pixel_clock;
-};
-
-struct encoder_pre_enable_output_param {
-	struct hw_crtc_timing crtc_timing;
-	struct link_settings link_settings;
-	struct encoder_context enc_ctx;
-};
-
-struct encoder_unblank_param {
-	struct hw_crtc_timing crtc_timing;
-	struct link_settings link_settings;
-};
-
-/*
- * @brief
- * Parameters to setup stereo 3D mode in Encoder:
- * - source: used for side-band stereo sync (DVO/DAC);
- * - engine_id: defines engine for this Encoder;
- * - enable_inband: in-band stereo sync should be enabled;
- * - enable_sideband: side-band stereo sync should be enabled.
- */
-struct encoder_3d_setup {
-	enum engine_id engine;
-	enum sync_source source;
-	union {
-		struct {
-			uint32_t SETUP_SYNC_SOURCE:1;
-			uint32_t ENABLE_INBAND:1;
-			uint32_t ENABLE_SIDEBAND:1;
-			uint32_t DISABLE_INBAND:1;
-			uint32_t DISABLE_SIDEBAND:1;
-		} bits;
-		uint32_t raw;
-	} flags;
-};
-
-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;
-};
-
-enum dig_encoder_mode {
-	DIG_ENCODER_MODE_DP,
-	DIG_ENCODER_MODE_LVDS,
-	DIG_ENCODER_MODE_DVI,
-	DIG_ENCODER_MODE_HDMI,
-	DIG_ENCODER_MODE_SDVO,
-	DIG_ENCODER_MODE_DP_WITH_AUDIO,
-	DIG_ENCODER_MODE_DP_MST,
-
-	/* direct HW translation ! */
-	DIG_ENCODER_MODE_TV = 13,
-	DIG_ENCODER_MODE_CV,
-	DIG_ENCODER_MODE_CRT
-};
-
-#endif
-
diff --git a/drivers/gpu/drm/amd/dal/include/fixed31_32.h b/drivers/gpu/drm/amd/dal/include/fixed31_32.h
index 507f9f6..4577809 100644
--- a/drivers/gpu/drm/amd/dal/include/fixed31_32.h
+++ b/drivers/gpu/drm/amd/dal/include/fixed31_32.h
@@ -26,6 +26,8 @@
 #ifndef __DAL_FIXED31_32_H__
 #define __DAL_FIXED31_32_H__
 
+#include "dal_services_types.h"
+
 /*
  * @brief
  * Arithmetic operations on real numbers
diff --git a/drivers/gpu/drm/amd/dal/include/fixed32_32.h b/drivers/gpu/drm/amd/dal/include/fixed32_32.h
index 5fca957..5291a30 100644
--- a/drivers/gpu/drm/amd/dal/include/fixed32_32.h
+++ b/drivers/gpu/drm/amd/dal/include/fixed32_32.h
@@ -26,6 +26,9 @@
 #ifndef __DAL_FIXED32_32_H__
 #define __DAL_FIXED32_32_H__
 
+#include "dal_services_types.h"
+
+
 struct fixed32_32 {
 	uint64_t value;
 };
-- 
2.7.4