Commit | Line | Data |
---|---|---|
4562236b HW |
1 | /* |
2 | * Copyright 2012-15 Advanced Micro Devices, Inc. | |
3 | * | |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | |
5 | * copy of this software and associated documentation files (the "Software"), | |
6 | * to deal in the Software without restriction, including without limitation | |
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
8 | * and/or sell copies of the Software, and to permit persons to whom the | |
9 | * Software is furnished to do so, subject to the following conditions: | |
10 | * | |
11 | * The above copyright notice and this permission notice shall be included in | |
12 | * all copies or substantial portions of the Software. | |
13 | * | |
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | |
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |
20 | * OTHER DEALINGS IN THE SOFTWARE. | |
21 | * | |
22 | * Authors: AMD | |
23 | * | |
24 | */ | |
25 | #ifndef DC_TYPES_H_ | |
26 | #define DC_TYPES_H_ | |
27 | ||
28 | #include "fixed32_32.h" | |
29 | #include "fixed31_32.h" | |
30 | #include "irq_types.h" | |
31 | #include "dc_dp_types.h" | |
32 | #include "dc_hw_types.h" | |
33 | #include "dal_types.h" | |
9f72f51d | 34 | #include "grph_object_defs.h" |
4562236b HW |
35 | |
36 | /* forward declarations */ | |
c9614aeb | 37 | struct dc_plane_state; |
0971c40e | 38 | struct dc_stream_state; |
4562236b HW |
39 | struct dc_link; |
40 | struct dc_sink; | |
41 | struct dal; | |
42 | ||
43 | /******************************** | |
44 | * Environment definitions | |
45 | ********************************/ | |
46 | enum dce_environment { | |
47 | DCE_ENV_PRODUCTION_DRV = 0, | |
48 | /* Emulation on FPGA, in "Maximus" System. | |
49 | * This environment enforces that *only* DC registers accessed. | |
50 | * (access to non-DC registers will hang FPGA) */ | |
51 | DCE_ENV_FPGA_MAXIMUS, | |
52 | /* Emulation on real HW or on FPGA. Used by Diagnostics, enforces | |
53 | * requirements of Diagnostics team. */ | |
54 | DCE_ENV_DIAG | |
55 | }; | |
56 | ||
57 | /* Note: use these macro definitions instead of direct comparison! */ | |
58 | #define IS_FPGA_MAXIMUS_DC(dce_environment) \ | |
59 | (dce_environment == DCE_ENV_FPGA_MAXIMUS) | |
60 | ||
61 | #define IS_DIAG_DC(dce_environment) \ | |
62 | (IS_FPGA_MAXIMUS_DC(dce_environment) || (dce_environment == DCE_ENV_DIAG)) | |
63 | ||
64 | struct hw_asic_id { | |
65 | uint32_t chip_id; | |
66 | uint32_t chip_family; | |
67 | uint32_t pci_revision_id; | |
68 | uint32_t hw_internal_rev; | |
69 | uint32_t vram_type; | |
70 | uint32_t vram_width; | |
71 | uint32_t feature_flags; | |
72 | uint32_t fake_paths_num; | |
73 | void *atombios_base_address; | |
74 | }; | |
75 | ||
76 | struct dc_context { | |
77 | struct dc *dc; | |
78 | ||
79 | void *driver_context; /* e.g. amdgpu_device */ | |
80 | ||
81 | struct dal_logger *logger; | |
82 | void *cgs_device; | |
83 | ||
84 | enum dce_environment dce_environment; | |
85 | struct hw_asic_id asic_id; | |
86 | ||
87 | /* todo: below should probably move to dc. to facilitate removal | |
88 | * of AS we will store these here | |
89 | */ | |
90 | enum dce_version dce_version; | |
91 | struct dc_bios *dc_bios; | |
92 | bool created_bios; | |
93 | struct gpio_service *gpio_service; | |
94 | struct i2caux *i2caux; | |
3eab7916 | 95 | #if defined(CONFIG_DRM_AMD_DC_FBC) |
690b5e39 RL |
96 | uint64_t fbc_gpu_addr; |
97 | #endif | |
4562236b HW |
98 | }; |
99 | ||
100 | ||
101 | #define MAX_EDID_BUFFER_SIZE 512 | |
102 | #define EDID_BLOCK_SIZE 128 | |
ba326a91 | 103 | #define MAX_SURFACE_NUM 4 |
4562236b HW |
104 | #define NUM_PIXEL_FORMATS 10 |
105 | ||
106 | #include "dc_ddc_types.h" | |
107 | ||
108 | enum tiling_mode { | |
109 | TILING_MODE_INVALID, | |
110 | TILING_MODE_LINEAR, | |
111 | TILING_MODE_TILED, | |
112 | TILING_MODE_COUNT | |
113 | }; | |
114 | ||
115 | enum view_3d_format { | |
116 | VIEW_3D_FORMAT_NONE = 0, | |
117 | VIEW_3D_FORMAT_FRAME_SEQUENTIAL, | |
118 | VIEW_3D_FORMAT_SIDE_BY_SIDE, | |
119 | VIEW_3D_FORMAT_TOP_AND_BOTTOM, | |
120 | VIEW_3D_FORMAT_COUNT, | |
121 | VIEW_3D_FORMAT_FIRST = VIEW_3D_FORMAT_FRAME_SEQUENTIAL | |
122 | }; | |
123 | ||
124 | enum plane_stereo_format { | |
125 | PLANE_STEREO_FORMAT_NONE = 0, | |
126 | PLANE_STEREO_FORMAT_SIDE_BY_SIDE = 1, | |
127 | PLANE_STEREO_FORMAT_TOP_AND_BOTTOM = 2, | |
128 | PLANE_STEREO_FORMAT_FRAME_ALTERNATE = 3, | |
129 | PLANE_STEREO_FORMAT_ROW_INTERLEAVED = 5, | |
130 | PLANE_STEREO_FORMAT_COLUMN_INTERLEAVED = 6, | |
131 | PLANE_STEREO_FORMAT_CHECKER_BOARD = 7 | |
132 | }; | |
133 | ||
134 | /* TODO: Find way to calculate number of bits | |
135 | * Please increase if pixel_format enum increases | |
136 | * num from PIXEL_FORMAT_INDEX8 to PIXEL_FORMAT_444BPP32 | |
137 | */ | |
138 | ||
139 | enum dc_edid_connector_type { | |
140 | EDID_CONNECTOR_UNKNOWN = 0, | |
141 | EDID_CONNECTOR_ANALOG = 1, | |
142 | EDID_CONNECTOR_DIGITAL = 10, | |
143 | EDID_CONNECTOR_DVI = 11, | |
144 | EDID_CONNECTOR_HDMIA = 12, | |
145 | EDID_CONNECTOR_MDDI = 14, | |
146 | EDID_CONNECTOR_DISPLAYPORT = 15 | |
147 | }; | |
148 | ||
149 | enum dc_edid_status { | |
150 | EDID_OK, | |
151 | EDID_BAD_INPUT, | |
152 | EDID_NO_RESPONSE, | |
153 | EDID_BAD_CHECKSUM, | |
7d58e721 | 154 | EDID_THE_SAME, |
4562236b HW |
155 | }; |
156 | ||
157 | /* audio capability from EDID*/ | |
158 | struct dc_cea_audio_mode { | |
159 | uint8_t format_code; /* ucData[0] [6:3]*/ | |
160 | uint8_t channel_count; /* ucData[0] [2:0]*/ | |
161 | uint8_t sample_rate; /* ucData[1]*/ | |
162 | union { | |
163 | uint8_t sample_size; /* for LPCM*/ | |
164 | /* for Audio Formats 2-8 (Max bit rate divided by 8 kHz)*/ | |
165 | uint8_t max_bit_rate; | |
166 | uint8_t audio_codec_vendor_specific; /* for Audio Formats 9-15*/ | |
167 | }; | |
168 | }; | |
169 | ||
170 | struct dc_edid { | |
171 | uint32_t length; | |
172 | uint8_t raw_edid[MAX_EDID_BUFFER_SIZE]; | |
173 | }; | |
174 | ||
175 | /* When speaker location data block is not available, DEFAULT_SPEAKER_LOCATION | |
176 | * is used. In this case we assume speaker location are: front left, front | |
177 | * right and front center. */ | |
178 | #define DEFAULT_SPEAKER_LOCATION 5 | |
179 | ||
180 | #define DC_MAX_AUDIO_DESC_COUNT 16 | |
181 | ||
182 | #define AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS 20 | |
183 | ||
50e27654 ZF |
184 | union display_content_support { |
185 | unsigned int raw; | |
186 | struct { | |
187 | unsigned int valid_content_type :1; | |
188 | unsigned int game_content :1; | |
189 | unsigned int cinema_content :1; | |
190 | unsigned int photo_content :1; | |
191 | unsigned int graphics_content :1; | |
192 | unsigned int reserved :27; | |
193 | } bits; | |
194 | }; | |
195 | ||
4562236b HW |
196 | struct dc_edid_caps { |
197 | /* sink identification */ | |
198 | uint16_t manufacturer_id; | |
199 | uint16_t product_id; | |
200 | uint32_t serial_number; | |
201 | uint8_t manufacture_week; | |
202 | uint8_t manufacture_year; | |
203 | uint8_t display_name[AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS]; | |
204 | ||
205 | /* audio caps */ | |
206 | uint8_t speaker_flags; | |
207 | uint32_t audio_mode_count; | |
208 | struct dc_cea_audio_mode audio_modes[DC_MAX_AUDIO_DESC_COUNT]; | |
209 | uint32_t audio_latency; | |
210 | uint32_t video_latency; | |
211 | ||
50e27654 ZF |
212 | union display_content_support content_support; |
213 | ||
214 | uint8_t qs_bit; | |
215 | uint8_t qy_bit; | |
216 | ||
4562236b HW |
217 | /*HDMI 2.0 caps*/ |
218 | bool lte_340mcsc_scramble; | |
219 | ||
220 | bool edid_hdmi; | |
506ab334 | 221 | bool hdr_supported; |
4562236b HW |
222 | }; |
223 | ||
224 | struct view { | |
225 | uint32_t width; | |
226 | uint32_t height; | |
227 | }; | |
228 | ||
229 | struct dc_mode_flags { | |
230 | /* note: part of refresh rate flag*/ | |
231 | uint32_t INTERLACE :1; | |
232 | /* native display timing*/ | |
233 | uint32_t NATIVE :1; | |
234 | /* preferred is the recommended mode, one per display */ | |
235 | uint32_t PREFERRED :1; | |
236 | /* true if this mode should use reduced blanking timings | |
237 | *_not_ related to the Reduced Blanking adjustment*/ | |
238 | uint32_t REDUCED_BLANKING :1; | |
239 | /* note: part of refreshrate flag*/ | |
240 | uint32_t VIDEO_OPTIMIZED_RATE :1; | |
241 | /* should be reported to upper layers as mode_flags*/ | |
242 | uint32_t PACKED_PIXEL_FORMAT :1; | |
243 | /*< preferred view*/ | |
244 | uint32_t PREFERRED_VIEW :1; | |
245 | /* this timing should be used only in tiled mode*/ | |
246 | uint32_t TILED_MODE :1; | |
247 | uint32_t DSE_MODE :1; | |
248 | /* Refresh rate divider when Miracast sink is using a | |
249 | different rate than the output display device | |
250 | Must be zero for wired displays and non-zero for | |
251 | Miracast displays*/ | |
252 | uint32_t MIRACAST_REFRESH_DIVIDER; | |
253 | }; | |
254 | ||
255 | ||
256 | enum dc_timing_source { | |
257 | TIMING_SOURCE_UNDEFINED, | |
258 | ||
259 | /* explicitly specifed by user, most important*/ | |
260 | TIMING_SOURCE_USER_FORCED, | |
261 | TIMING_SOURCE_USER_OVERRIDE, | |
262 | TIMING_SOURCE_CUSTOM, | |
263 | TIMING_SOURCE_EXPLICIT, | |
264 | ||
265 | /* explicitly specified by the display device, more important*/ | |
266 | TIMING_SOURCE_EDID_CEA_SVD_3D, | |
267 | TIMING_SOURCE_EDID_CEA_SVD_PREFERRED, | |
268 | TIMING_SOURCE_EDID_CEA_SVD_420, | |
269 | TIMING_SOURCE_EDID_DETAILED, | |
270 | TIMING_SOURCE_EDID_ESTABLISHED, | |
271 | TIMING_SOURCE_EDID_STANDARD, | |
272 | TIMING_SOURCE_EDID_CEA_SVD, | |
273 | TIMING_SOURCE_EDID_CVT_3BYTE, | |
274 | TIMING_SOURCE_EDID_4BYTE, | |
275 | TIMING_SOURCE_VBIOS, | |
276 | TIMING_SOURCE_CV, | |
277 | TIMING_SOURCE_TV, | |
278 | TIMING_SOURCE_HDMI_VIC, | |
279 | ||
280 | /* implicitly specified by display device, still safe but less important*/ | |
281 | TIMING_SOURCE_DEFAULT, | |
282 | ||
283 | /* only used for custom base modes */ | |
284 | TIMING_SOURCE_CUSTOM_BASE, | |
285 | ||
286 | /* these timing might not work, least important*/ | |
287 | TIMING_SOURCE_RANGELIMIT, | |
288 | TIMING_SOURCE_OS_FORCED, | |
289 | TIMING_SOURCE_IMPLICIT, | |
290 | ||
291 | /* only used by default mode list*/ | |
292 | TIMING_SOURCE_BASICMODE, | |
293 | ||
294 | TIMING_SOURCE_COUNT | |
295 | }; | |
296 | ||
b6d6103b VP |
297 | |
298 | struct stereo_3d_features { | |
299 | bool supported ; | |
300 | bool allTimings ; | |
301 | bool cloneMode ; | |
302 | bool scaling ; | |
303 | bool singleFrameSWPacked; | |
304 | }; | |
305 | ||
4562236b HW |
306 | enum dc_timing_support_method { |
307 | TIMING_SUPPORT_METHOD_UNDEFINED, | |
308 | TIMING_SUPPORT_METHOD_EXPLICIT, | |
309 | TIMING_SUPPORT_METHOD_IMPLICIT, | |
310 | TIMING_SUPPORT_METHOD_NATIVE | |
311 | }; | |
312 | ||
313 | struct dc_mode_info { | |
314 | uint32_t pixel_width; | |
315 | uint32_t pixel_height; | |
316 | uint32_t field_rate; | |
317 | /* Vertical refresh rate for progressive modes. | |
318 | * Field rate for interlaced modes.*/ | |
319 | ||
320 | enum dc_timing_standard timing_standard; | |
321 | enum dc_timing_source timing_source; | |
322 | struct dc_mode_flags flags; | |
323 | }; | |
324 | ||
325 | enum dc_power_state { | |
326 | DC_POWER_STATE_ON = 1, | |
327 | DC_POWER_STATE_STANDBY, | |
328 | DC_POWER_STATE_SUSPEND, | |
329 | DC_POWER_STATE_OFF | |
330 | }; | |
331 | ||
332 | /* DC PowerStates */ | |
333 | enum dc_video_power_state { | |
334 | DC_VIDEO_POWER_UNSPECIFIED = 0, | |
335 | DC_VIDEO_POWER_ON = 1, | |
336 | DC_VIDEO_POWER_STANDBY, | |
337 | DC_VIDEO_POWER_SUSPEND, | |
338 | DC_VIDEO_POWER_OFF, | |
339 | DC_VIDEO_POWER_HIBERNATE, | |
340 | DC_VIDEO_POWER_SHUTDOWN, | |
341 | DC_VIDEO_POWER_ULPS, /* BACO or Ultra-Light-Power-State */ | |
342 | DC_VIDEO_POWER_AFTER_RESET, | |
343 | DC_VIDEO_POWER_MAXIMUM | |
344 | }; | |
345 | ||
346 | enum dc_acpi_cm_power_state { | |
347 | DC_ACPI_CM_POWER_STATE_D0 = 1, | |
348 | DC_ACPI_CM_POWER_STATE_D1 = 2, | |
349 | DC_ACPI_CM_POWER_STATE_D2 = 4, | |
350 | DC_ACPI_CM_POWER_STATE_D3 = 8 | |
351 | }; | |
352 | ||
353 | enum dc_connection_type { | |
354 | dc_connection_none, | |
355 | dc_connection_single, | |
356 | dc_connection_mst_branch, | |
357 | dc_connection_active_dongle | |
358 | }; | |
359 | ||
360 | struct dc_csc_adjustments { | |
361 | struct fixed31_32 contrast; | |
362 | struct fixed31_32 saturation; | |
363 | struct fixed31_32 brightness; | |
364 | struct fixed31_32 hue; | |
365 | }; | |
366 | ||
367 | enum { | |
368 | MAX_LANES = 2, | |
369 | MAX_COFUNC_PATH = 6, | |
370 | LAYER_INDEX_PRIMARY = -1, | |
371 | }; | |
372 | ||
03f5c686 CL |
373 | enum dpcd_downstream_port_max_bpc { |
374 | DOWN_STREAM_MAX_8BPC = 0, | |
375 | DOWN_STREAM_MAX_10BPC, | |
376 | DOWN_STREAM_MAX_12BPC, | |
377 | DOWN_STREAM_MAX_16BPC | |
378 | }; | |
379 | struct dc_dongle_caps { | |
380 | /* dongle type (DP converter, CV smart dongle) */ | |
381 | enum display_dongle_type dongle_type; | |
382 | bool extendedCapValid; | |
383 | /* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER, | |
384 | indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/ | |
385 | bool is_dp_hdmi_s3d_converter; | |
386 | bool is_dp_hdmi_ycbcr422_pass_through; | |
387 | bool is_dp_hdmi_ycbcr420_pass_through; | |
388 | bool is_dp_hdmi_ycbcr422_converter; | |
389 | bool is_dp_hdmi_ycbcr420_converter; | |
390 | uint32_t dp_hdmi_max_bpc; | |
391 | uint32_t dp_hdmi_max_pixel_clk; | |
392 | }; | |
4562236b HW |
393 | /* Scaling format */ |
394 | enum scaling_transformation { | |
395 | SCALING_TRANSFORMATION_UNINITIALIZED, | |
396 | SCALING_TRANSFORMATION_IDENTITY = 0x0001, | |
397 | SCALING_TRANSFORMATION_CENTER_TIMING = 0x0002, | |
398 | SCALING_TRANSFORMATION_FULL_SCREEN_SCALE = 0x0004, | |
399 | SCALING_TRANSFORMATION_PRESERVE_ASPECT_RATIO_SCALE = 0x0008, | |
400 | SCALING_TRANSFORMATION_DAL_DECIDE = 0x0010, | |
401 | SCALING_TRANSFORMATION_INVALID = 0x80000000, | |
402 | ||
403 | /* Flag the first and last */ | |
404 | SCALING_TRANSFORMATION_BEGING = SCALING_TRANSFORMATION_IDENTITY, | |
405 | SCALING_TRANSFORMATION_END = | |
406 | SCALING_TRANSFORMATION_PRESERVE_ASPECT_RATIO_SCALE | |
407 | }; | |
408 | ||
50e27654 ZF |
409 | enum display_content_type { |
410 | DISPLAY_CONTENT_TYPE_NO_DATA = 0, | |
411 | DISPLAY_CONTENT_TYPE_GRAPHICS = 1, | |
412 | DISPLAY_CONTENT_TYPE_PHOTO = 2, | |
413 | DISPLAY_CONTENT_TYPE_CINEMA = 4, | |
414 | DISPLAY_CONTENT_TYPE_GAME = 8 | |
415 | }; | |
416 | ||
4562236b HW |
417 | /* audio*/ |
418 | ||
419 | union audio_sample_rates { | |
420 | struct sample_rates { | |
421 | uint8_t RATE_32:1; | |
422 | uint8_t RATE_44_1:1; | |
423 | uint8_t RATE_48:1; | |
424 | uint8_t RATE_88_2:1; | |
425 | uint8_t RATE_96:1; | |
426 | uint8_t RATE_176_4:1; | |
427 | uint8_t RATE_192:1; | |
428 | } rate; | |
429 | ||
430 | uint8_t all; | |
431 | }; | |
432 | ||
433 | struct audio_speaker_flags { | |
5667ff5c DA |
434 | uint32_t FL_FR:1; |
435 | uint32_t LFE:1; | |
436 | uint32_t FC:1; | |
437 | uint32_t RL_RR:1; | |
438 | uint32_t RC:1; | |
439 | uint32_t FLC_FRC:1; | |
440 | uint32_t RLC_RRC:1; | |
441 | uint32_t SUPPORT_AI:1; | |
4562236b HW |
442 | }; |
443 | ||
444 | struct audio_speaker_info { | |
445 | uint32_t ALLSPEAKERS:7; | |
446 | uint32_t SUPPORT_AI:1; | |
447 | }; | |
448 | ||
449 | ||
450 | struct audio_info_flags { | |
451 | ||
452 | union { | |
453 | ||
454 | struct audio_speaker_flags speaker_flags; | |
455 | struct audio_speaker_info info; | |
456 | ||
457 | uint8_t all; | |
458 | }; | |
459 | }; | |
460 | ||
461 | enum audio_format_code { | |
462 | AUDIO_FORMAT_CODE_FIRST = 1, | |
463 | AUDIO_FORMAT_CODE_LINEARPCM = AUDIO_FORMAT_CODE_FIRST, | |
464 | ||
465 | AUDIO_FORMAT_CODE_AC3, | |
466 | /*Layers 1 & 2 */ | |
467 | AUDIO_FORMAT_CODE_MPEG1, | |
468 | /*MPEG1 Layer 3 */ | |
469 | AUDIO_FORMAT_CODE_MP3, | |
470 | /*multichannel */ | |
471 | AUDIO_FORMAT_CODE_MPEG2, | |
472 | AUDIO_FORMAT_CODE_AAC, | |
473 | AUDIO_FORMAT_CODE_DTS, | |
474 | AUDIO_FORMAT_CODE_ATRAC, | |
475 | AUDIO_FORMAT_CODE_1BITAUDIO, | |
476 | AUDIO_FORMAT_CODE_DOLBYDIGITALPLUS, | |
477 | AUDIO_FORMAT_CODE_DTS_HD, | |
478 | AUDIO_FORMAT_CODE_MAT_MLP, | |
479 | AUDIO_FORMAT_CODE_DST, | |
480 | AUDIO_FORMAT_CODE_WMAPRO, | |
481 | AUDIO_FORMAT_CODE_LAST, | |
482 | AUDIO_FORMAT_CODE_COUNT = | |
483 | AUDIO_FORMAT_CODE_LAST - AUDIO_FORMAT_CODE_FIRST | |
484 | }; | |
485 | ||
486 | struct audio_mode { | |
487 | /* ucData[0] [6:3] */ | |
488 | enum audio_format_code format_code; | |
489 | /* ucData[0] [2:0] */ | |
490 | uint8_t channel_count; | |
491 | /* ucData[1] */ | |
492 | union audio_sample_rates sample_rates; | |
493 | union { | |
494 | /* for LPCM */ | |
495 | uint8_t sample_size; | |
496 | /* for Audio Formats 2-8 (Max bit rate divided by 8 kHz) */ | |
497 | uint8_t max_bit_rate; | |
498 | /* for Audio Formats 9-15 */ | |
499 | uint8_t vendor_specific; | |
500 | }; | |
501 | }; | |
502 | ||
503 | struct audio_info { | |
504 | struct audio_info_flags flags; | |
505 | uint32_t video_latency; | |
506 | uint32_t audio_latency; | |
507 | uint32_t display_index; | |
508 | uint8_t display_name[AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS]; | |
509 | uint32_t manufacture_id; | |
510 | uint32_t product_id; | |
511 | /* PortID used for ContainerID when defined */ | |
512 | uint32_t port_id[2]; | |
513 | uint32_t mode_count; | |
514 | /* this field must be last in this struct */ | |
515 | struct audio_mode modes[DC_MAX_AUDIO_DESC_COUNT]; | |
516 | }; | |
517 | ||
518 | struct freesync_context { | |
519 | bool supported; | |
520 | bool enabled; | |
521 | bool active; | |
522 | ||
523 | unsigned int min_refresh_in_micro_hz; | |
524 | unsigned int nominal_refresh_in_micro_hz; | |
525 | }; | |
526 | ||
94267b3d ST |
527 | struct psr_config { |
528 | unsigned char psr_version; | |
529 | unsigned int psr_rfb_setup_time; | |
530 | bool psr_exit_link_training_required; | |
531 | ||
532 | bool psr_frame_capture_indication_req; | |
533 | unsigned int psr_sdp_transmit_line_num_deadline; | |
534 | }; | |
535 | ||
9f72f51d AZ |
536 | union dmcu_psr_level { |
537 | struct { | |
538 | unsigned int SKIP_CRC:1; | |
539 | unsigned int SKIP_DP_VID_STREAM_DISABLE:1; | |
540 | unsigned int SKIP_PHY_POWER_DOWN:1; | |
541 | unsigned int SKIP_AUX_ACK_CHECK:1; | |
542 | unsigned int SKIP_CRTC_DISABLE:1; | |
543 | unsigned int SKIP_AUX_RFB_CAPTURE_CHECK:1; | |
544 | unsigned int SKIP_SMU_NOTIFICATION:1; | |
545 | unsigned int SKIP_AUTO_STATE_ADVANCE:1; | |
546 | unsigned int DISABLE_PSR_ENTRY_ABORT:1; | |
ee356d8f CL |
547 | unsigned int SKIP_SINGLE_OTG_DISABLE:1; |
548 | unsigned int RESERVED:22; | |
9f72f51d AZ |
549 | } bits; |
550 | unsigned int u32all; | |
551 | }; | |
552 | ||
553 | enum physical_phy_id { | |
554 | PHYLD_0, | |
555 | PHYLD_1, | |
556 | PHYLD_2, | |
557 | PHYLD_3, | |
558 | PHYLD_4, | |
559 | PHYLD_5, | |
560 | PHYLD_6, | |
561 | PHYLD_7, | |
562 | PHYLD_8, | |
563 | PHYLD_9, | |
564 | PHYLD_COUNT, | |
565 | PHYLD_UNKNOWN = (-1L) | |
566 | }; | |
567 | ||
568 | enum phy_type { | |
569 | PHY_TYPE_UNKNOWN = 1, | |
570 | PHY_TYPE_PCIE_PHY = 2, | |
571 | PHY_TYPE_UNIPHY = 3, | |
572 | }; | |
573 | ||
574 | struct psr_context { | |
575 | /* ddc line */ | |
576 | enum channel_id channel; | |
577 | /* Transmitter id */ | |
578 | enum transmitter transmitterId; | |
579 | /* Engine Id is used for Dig Be source select */ | |
580 | enum engine_id engineId; | |
581 | /* Controller Id used for Dig Fe source select */ | |
582 | enum controller_id controllerId; | |
583 | /* Pcie or Uniphy */ | |
584 | enum phy_type phyType; | |
585 | /* Physical PHY Id used by SMU interpretation */ | |
586 | enum physical_phy_id smuPhyId; | |
587 | /* Vertical total pixels from crtc timing. | |
588 | * This is used for static screen detection. | |
589 | * ie. If we want to detect half a frame, | |
590 | * we use this to determine the hyst lines. | |
591 | */ | |
592 | unsigned int crtcTimingVerticalTotal; | |
593 | /* PSR supported from panel capabilities and | |
594 | * current display configuration | |
595 | */ | |
596 | bool psrSupportedDisplayConfig; | |
597 | /* Whether fast link training is supported by the panel */ | |
598 | bool psrExitLinkTrainingRequired; | |
599 | /* If RFB setup time is greater than the total VBLANK time, | |
600 | * it is not possible for the sink to capture the video frame | |
601 | * in the same frame the SDP is sent. In this case, | |
602 | * the frame capture indication bit should be set and an extra | |
603 | * static frame should be transmitted to the sink. | |
604 | */ | |
605 | bool psrFrameCaptureIndicationReq; | |
606 | /* Set the last possible line SDP may be transmitted without violating | |
607 | * the RFB setup time or entering the active video frame. | |
608 | */ | |
609 | unsigned int sdpTransmitLineNumDeadline; | |
610 | /* The VSync rate in Hz used to calculate the | |
611 | * step size for smooth brightness feature | |
612 | */ | |
613 | unsigned int vsyncRateHz; | |
614 | unsigned int skipPsrWaitForPllLock; | |
615 | unsigned int numberOfControllers; | |
616 | /* Unused, for future use. To indicate that first changed frame from | |
617 | * state3 shouldn't result in psr_inactive, but rather to perform | |
618 | * an automatic single frame rfb_update. | |
619 | */ | |
620 | bool rfb_update_auto_en; | |
621 | /* Number of frame before entering static screen */ | |
622 | unsigned int timehyst_frames; | |
623 | /* Partial frames before entering static screen */ | |
624 | unsigned int hyst_lines; | |
625 | /* # of repeated AUX transaction attempts to make before | |
626 | * indicating failure to the driver | |
627 | */ | |
628 | unsigned int aux_repeats; | |
629 | /* Controls hw blocks to power down during PSR active state */ | |
630 | union dmcu_psr_level psr_level; | |
631 | /* Controls additional delay after remote frame capture before | |
632 | * continuing powerd own | |
633 | */ | |
634 | unsigned int frame_delay; | |
635 | }; | |
636 | ||
4562236b HW |
637 | struct colorspace_transform { |
638 | struct fixed31_32 matrix[12]; | |
639 | bool enable_remap; | |
640 | }; | |
641 | ||
7c7f5b15 AG |
642 | enum i2c_mot_mode { |
643 | I2C_MOT_UNDEF, | |
644 | I2C_MOT_TRUE, | |
645 | I2C_MOT_FALSE | |
646 | }; | |
647 | ||
4562236b | 648 | #endif /* DC_TYPES_H_ */ |