2 * Copyright © 2006-2016 Intel Corporation
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:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 * This information is private to VBT parsing in intel_bios.c.
31 * Please do NOT include anywhere else.
33 #ifndef _INTEL_BIOS_PRIVATE
34 #error "intel_vbt_defs.h is private to intel_bios.c"
37 #ifndef _INTEL_VBT_DEFS_H_
38 #define _INTEL_VBT_DEFS_H_
40 #include "intel_bios.h"
42 /* EDID derived structures */
43 struct bdb_edid_pnp_id {
51 struct bdb_edid_product_name {
56 u16 clock; /**< In 10khz */
66 u8 hsync_pulse_width_lo;
67 u8 vsync_pulse_width_lo:4;
69 u8 vsync_pulse_width_hi:2;
71 u8 hsync_pulse_width_hi:2;
87 * struct vbt_header - VBT Header structure
88 * @signature: VBT signature, always starts with "$VBT"
89 * @version: Version of this structure
90 * @header_size: Size of this structure
91 * @vbt_size: Size of VBT (VBT Header, BDB Header and data blocks)
92 * @vbt_checksum: Checksum
93 * @reserved0: Reserved
94 * @bdb_offset: Offset of &struct bdb_header from beginning of VBT
95 * @aim_offset: Offsets of add-in data blocks from beginning of VBT
109 * struct bdb_header - BDB Header structure
110 * @signature: BDB signature "BIOS_DATA_BLOCK"
111 * @version: Version of the data block definitions
112 * @header_size: Size of this structure
113 * @bdb_size: Size of BDB (BDB Header and data blocks)
123 * BDB version number dependencies are documented as:
126 * indicates the field was introduced in version <start>
130 * indicates the field was introduced in version <start>
131 * and obsoleted in version <end>+1.
133 * ??? indicates the specific version number is unknown
137 * There are several types of BIOS data blocks (BDBs), each block has
138 * an ID and size in the first 3 bytes (ID in first, size in next 2).
139 * Known types are listed below.
142 BDB_GENERAL_FEATURES = 1,
143 BDB_GENERAL_DEFINITIONS = 2,
144 BDB_DISPLAY_TOGGLE = 3,
145 BDB_MODE_SUPPORT_LIST = 4,
146 BDB_GENERIC_MODE_TABLE = 5,
147 BDB_EXT_MMIO_REGS = 6, /* VBIOS only */
148 BDB_SWF_IO = 7, /* VBIOS only */
149 BDB_SWF_MMIO = 8, /* VBIOS only */
150 BDB_DOT_CLOCK_OVERRIDE_ALM = 9,
151 BDB_PSR = 9, /* 165+ */
152 BDB_MODE_REMOVAL_TABLE = 10,
153 BDB_CHILD_DEVICE_TABLE = 11,
154 BDB_DRIVER_FEATURES = 12,
155 BDB_DRIVER_PERSISTENCE = 13,
156 BDB_EXT_TABLE_PTRS = 14, /* VBIOS only */
157 BDB_DOT_CLOCK_OVERRIDE = 15,
158 BDB_DISPLAY_SELECT_OLD = 16,
159 BDB_SV_TEST_FUNCTIONS = 17,
160 BDB_DRIVER_ROTATION = 18,
161 BDB_DISPLAY_REMOVE_OLD = 19,
163 BDB_EFP_LIST = 21, /* workarounds for VGA hsync/vsync */
164 BDB_SDVO_LVDS_OPTIONS = 22,
165 BDB_SDVO_LVDS_DTD = 23,
166 BDB_SDVO_LVDS_PNP_ID = 24,
167 BDB_SDVO_LVDS_PPS = 25,
170 BDB_EFP_DTD = 28, /* 161+ */
171 BDB_DISPLAY_SELECT_IVB = 29, /* 164+ */
172 BDB_DISPLAY_REMOVE_IVB = 30, /* 164+ */
173 BDB_DISPLAY_SELECT_HSW = 31, /* 166+ */
174 BDB_DISPLAY_REMOVE_HSW = 32, /* 166+ */
175 BDB_LFP_OPTIONS = 40,
176 BDB_LFP_DATA_PTRS = 41,
178 BDB_LFP_BACKLIGHT = 43,
180 BDB_EDP_BFI = 45, /* 160+ */
181 BDB_CHROMATICITY = 46, /* 169+ */
182 BDB_MIPI = 50, /* 170-172 */
183 BDB_FIXED_SET_MODE = 51, /* 172+ */
184 BDB_MIPI_CONFIG = 52, /* 175+ */
185 BDB_MIPI_SEQUENCE = 53, /* 177+ */
186 BDB_RGB_PALETTE = 54, /* 180+ */
187 BDB_COMPRESSION_PARAMETERS_OLD = 55, /* 198-212 */
188 BDB_COMPRESSION_PARAMETERS = 56, /* 213+ */
189 BDB_VSWING_PREEMPH = 57, /* 218+ */
190 BDB_GENERIC_DTD = 58, /* 229+ */
191 BDB_INT15_HOOK = 252, /* VBIOS only */
193 BDB_SKIP = 254, /* VBIOS only */
197 * Block 1 - General Bit Definitions
200 struct bdb_general_features {
209 u8 download_ext_vbt:1;
212 u8 enable_lfp_on_override:1;
213 u8 disable_ssc_ddt:1;
214 u8 underscan_vga_timings:1;
215 u8 display_clock_mode:1;
216 u8 vbios_hotplug_support:1;
219 u8 disable_smooth_vision:1;
221 u8 rotate_180:1; /* 181+ */
222 u8 fdi_rx_polarity_inverted:1;
223 u8 vbios_extended_mode:1; /* 160+ */
224 u8 copy_ilfp_dtd_to_sdvo_lvds_dtd:1; /* 160+ */
225 u8 panel_best_fit_timing:1; /* 160+ */
226 u8 ignore_strap_state:1; /* 160+ */
229 u8 legacy_monitor_detect;
232 u8 int_crt_support:1;
234 u8 int_efp_support:1;
235 u8 dp_ssc_enable:1; /* PCH attached eDP supports SSC */
236 u8 dp_ssc_freq:1; /* SSC freq for PCH attached eDP */
237 u8 dp_ssc_dongle_supported:1;
238 u8 rsvd11:2; /* finish byte */
241 u8 tc_hpd_retry_timeout:7; /* 242+ */
245 u8 afc_startup_config:2; /* 249+ */
250 * Block 2 - General Bytes Definition
254 #define GPIO_PIN_DVI_LVDS 0x03 /* "DVI/LVDS DDC GPIO pins" */
255 #define GPIO_PIN_ADD_I2C 0x05 /* "ADDCARD I2C GPIO pins" */
256 #define GPIO_PIN_ADD_DDC 0x04 /* "ADDCARD DDC GPIO pins" */
257 #define GPIO_PIN_ADD_DDC_I2C 0x06 /* "ADDCARD DDC/I2C GPIO pins" */
260 #define DEVICE_HANDLE_CRT 0x0001
261 #define DEVICE_HANDLE_TV 0x0002 /* ???-214 */
262 #define DEVICE_HANDLE_EFP1 0x0004
263 #define DEVICE_HANDLE_EFP2 0x0040
264 #define DEVICE_HANDLE_EFP3 0x0020
265 #define DEVICE_HANDLE_EFP4 0x0010
266 #define DEVICE_HANDLE_EFP5 0x0002 /* 215+ */
267 #define DEVICE_HANDLE_EFP6 0x0001 /* 217+ */
268 #define DEVICE_HANDLE_EFP7 0x0100 /* 217+ */
269 #define DEVICE_HANDLE_EFP8 0x0200 /* 217+ */
270 #define DEVICE_HANDLE_LFP1 0x0008
271 #define DEVICE_HANDLE_LFP2 0x0080
274 #define DEVICE_TYPE_NONE 0x00
275 #define DEVICE_TYPE_CRT 0x01
276 #define DEVICE_TYPE_TV 0x09
277 #define DEVICE_TYPE_EFP 0x12
278 #define DEVICE_TYPE_LFP 0x22
280 #define DEVICE_TYPE_CRT_DPMS 0x6001
281 #define DEVICE_TYPE_CRT_DPMS_HOTPLUG 0x4001
282 #define DEVICE_TYPE_TV_COMPOSITE 0x0209
283 #define DEVICE_TYPE_TV_MACROVISION 0x0289
284 #define DEVICE_TYPE_TV_RF_COMPOSITE 0x020c
285 #define DEVICE_TYPE_TV_SVIDEO_COMPOSITE 0x0609
286 #define DEVICE_TYPE_TV_SCART 0x0209
287 #define DEVICE_TYPE_TV_CODEC_HOTPLUG_PWR 0x6009
288 #define DEVICE_TYPE_EFP_HOTPLUG_PWR 0x6012
289 #define DEVICE_TYPE_EFP_DVI_HOTPLUG_PWR 0x6052
290 #define DEVICE_TYPE_EFP_DVI_I 0x6053
291 #define DEVICE_TYPE_EFP_DVI_D_DUAL 0x6152
292 #define DEVICE_TYPE_EFP_DVI_D_HDCP 0x60d2
293 #define DEVICE_TYPE_OPENLDI_HOTPLUG_PWR 0x6062
294 #define DEVICE_TYPE_OPENLDI_DUALPIX 0x6162
295 #define DEVICE_TYPE_LFP_PANELLINK 0x5012
296 #define DEVICE_TYPE_LFP_CMOS_PWR 0x5042
297 #define DEVICE_TYPE_LFP_LVDS_PWR 0x5062
298 #define DEVICE_TYPE_LFP_LVDS_DUAL 0x5162
299 #define DEVICE_TYPE_LFP_LVDS_DUAL_HDCP 0x51e2
301 /* Add the device class for LFP, TV, HDMI */
302 #define DEVICE_TYPE_INT_LFP 0x1022
303 #define DEVICE_TYPE_INT_TV 0x1009
304 #define DEVICE_TYPE_HDMI 0x60D2
305 #define DEVICE_TYPE_DP 0x68C6
306 #define DEVICE_TYPE_DP_DUAL_MODE 0x60D6
307 #define DEVICE_TYPE_eDP 0x78C6
309 #define DEVICE_TYPE_CLASS_EXTENSION (1 << 15)
310 #define DEVICE_TYPE_POWER_MANAGEMENT (1 << 14)
311 #define DEVICE_TYPE_HOTPLUG_SIGNALING (1 << 13)
312 #define DEVICE_TYPE_INTERNAL_CONNECTOR (1 << 12)
313 #define DEVICE_TYPE_NOT_HDMI_OUTPUT (1 << 11)
314 #define DEVICE_TYPE_MIPI_OUTPUT (1 << 10)
315 #define DEVICE_TYPE_COMPOSITE_OUTPUT (1 << 9)
316 #define DEVICE_TYPE_DUAL_CHANNEL (1 << 8)
317 #define DEVICE_TYPE_HIGH_SPEED_LINK (1 << 6)
318 #define DEVICE_TYPE_LVDS_SIGNALING (1 << 5)
319 #define DEVICE_TYPE_TMDS_DVI_SIGNALING (1 << 4)
320 #define DEVICE_TYPE_VIDEO_SIGNALING (1 << 3)
321 #define DEVICE_TYPE_DISPLAYPORT_OUTPUT (1 << 2)
322 #define DEVICE_TYPE_DIGITAL_OUTPUT (1 << 1)
323 #define DEVICE_TYPE_ANALOG_OUTPUT (1 << 0)
325 #define DEVICE_CFG_NONE 0x00
326 #define DEVICE_CFG_12BIT_DVOB 0x01
327 #define DEVICE_CFG_12BIT_DVOC 0x02
328 #define DEVICE_CFG_24BIT_DVOBC 0x09
329 #define DEVICE_CFG_24BIT_DVOCB 0x0a
330 #define DEVICE_CFG_DUAL_DVOB 0x11
331 #define DEVICE_CFG_DUAL_DVOC 0x12
332 #define DEVICE_CFG_DUAL_DVOBC 0x13
333 #define DEVICE_CFG_DUAL_LINK_DVOBC 0x19
334 #define DEVICE_CFG_DUAL_LINK_DVOCB 0x1a
336 #define DEVICE_WIRE_NONE 0x00
337 #define DEVICE_WIRE_DVOB 0x01
338 #define DEVICE_WIRE_DVOC 0x02
339 #define DEVICE_WIRE_DVOBC 0x03
340 #define DEVICE_WIRE_DVOBB 0x05
341 #define DEVICE_WIRE_DVOCC 0x06
342 #define DEVICE_WIRE_DVOB_MASTER 0x0d
343 #define DEVICE_WIRE_DVOC_MASTER 0x0e
345 /* dvo_port pre BDB 155 */
346 #define DEVICE_PORT_DVOA 0x00 /* none on 845+ */
347 #define DEVICE_PORT_DVOB 0x01
348 #define DEVICE_PORT_DVOC 0x02
350 /* dvo_port BDB 155+ */
351 #define DVO_PORT_HDMIA 0
352 #define DVO_PORT_HDMIB 1
353 #define DVO_PORT_HDMIC 2
354 #define DVO_PORT_HDMID 3
355 #define DVO_PORT_LVDS 4
356 #define DVO_PORT_TV 5
357 #define DVO_PORT_CRT 6
358 #define DVO_PORT_DPB 7
359 #define DVO_PORT_DPC 8
360 #define DVO_PORT_DPD 9
361 #define DVO_PORT_DPA 10
362 #define DVO_PORT_DPE 11 /* 193+ */
363 #define DVO_PORT_HDMIE 12 /* 193+ */
364 #define DVO_PORT_DPF 13 /* N/A */
365 #define DVO_PORT_HDMIF 14 /* N/A */
366 #define DVO_PORT_DPG 15 /* 217+ */
367 #define DVO_PORT_HDMIG 16 /* 217+ */
368 #define DVO_PORT_DPH 17 /* 217+ */
369 #define DVO_PORT_HDMIH 18 /* 217+ */
370 #define DVO_PORT_DPI 19 /* 217+ */
371 #define DVO_PORT_HDMII 20 /* 217+ */
372 #define DVO_PORT_MIPIA 21 /* 171+ */
373 #define DVO_PORT_MIPIB 22 /* 171+ */
374 #define DVO_PORT_MIPIC 23 /* 171+ */
375 #define DVO_PORT_MIPID 24 /* 171+ */
377 #define HDMI_MAX_DATA_RATE_PLATFORM 0 /* 204+ */
378 #define HDMI_MAX_DATA_RATE_297 1 /* 204+ */
379 #define HDMI_MAX_DATA_RATE_165 2 /* 204+ */
380 #define HDMI_MAX_DATA_RATE_594 3 /* 249+ */
381 #define HDMI_MAX_DATA_RATE_340 4 /* 249+ */
382 #define HDMI_MAX_DATA_RATE_300 5 /* 249+ */
384 #define LEGACY_CHILD_DEVICE_CONFIG_SIZE 33
386 /* DDC Bus DDI Type 155+ */
392 ICL_DDC_BUS_DDI_A = 0x1,
395 RKL_DDC_BUS_DDI_D = 0x3,
397 ICL_DDC_BUS_PORT_1 = 0x4,
403 ADLS_DDC_BUS_PORT_TC1 = 0x2,
404 ADLS_DDC_BUS_PORT_TC2,
405 ADLS_DDC_BUS_PORT_TC3,
406 ADLS_DDC_BUS_PORT_TC4,
407 ADLP_DDC_BUS_PORT_TC1 = 0x3,
408 ADLP_DDC_BUS_PORT_TC2,
409 ADLP_DDC_BUS_PORT_TC3,
410 ADLP_DDC_BUS_PORT_TC4
414 #define DP_AUX_A 0x40
415 #define DP_AUX_B 0x10
416 #define DP_AUX_C 0x20
417 #define DP_AUX_D 0x30
418 #define DP_AUX_E 0x50
419 #define DP_AUX_F 0x60
420 #define DP_AUX_G 0x70
421 #define DP_AUX_H 0x80
422 #define DP_AUX_I 0x90
424 /* DP max link rate 216+ */
425 #define BDB_216_VBT_DP_MAX_LINK_RATE_HBR3 0
426 #define BDB_216_VBT_DP_MAX_LINK_RATE_HBR2 1
427 #define BDB_216_VBT_DP_MAX_LINK_RATE_HBR 2
428 #define BDB_216_VBT_DP_MAX_LINK_RATE_LBR 3
430 /* DP max link rate 230+ */
431 #define BDB_230_VBT_DP_MAX_LINK_RATE_DEF 0
432 #define BDB_230_VBT_DP_MAX_LINK_RATE_LBR 1
433 #define BDB_230_VBT_DP_MAX_LINK_RATE_HBR 2
434 #define BDB_230_VBT_DP_MAX_LINK_RATE_HBR2 3
435 #define BDB_230_VBT_DP_MAX_LINK_RATE_HBR3 4
436 #define BDB_230_VBT_DP_MAX_LINK_RATE_UHBR10 5
437 #define BDB_230_VBT_DP_MAX_LINK_RATE_UHBR13P5 6
438 #define BDB_230_VBT_DP_MAX_LINK_RATE_UHBR20 7
441 * The child device config, aka the display device data structure, provides a
442 * description of a port and its configuration on the platform.
444 * The child device config size has been increased, and fields have been added
445 * and their meaning has changed over time. Care must be taken when accessing
446 * basically any of the fields to ensure the correct interpretation for the BDB
447 * version in question.
449 * When we copy the child device configs to dev_priv->display.vbt.child_dev, we
450 * reserve space for the full structure below, and initialize the tail not
451 * actually present in VBT to zeros. Accessing those fields is fine, as long as
452 * the default zero is taken into account, again according to the BDB version.
454 * BDB versions 155 and below are considered legacy, and version 155 seems to be
455 * a baseline for some of the VBT documentation. When adding new fields, please
456 * include the BDB version when the field was added, if it's above that.
458 struct child_device_config {
460 u16 device_type; /* See DEVICE_TYPE_* above */
463 u8 device_id[10]; /* ascii string */
466 u8 dp_onboard_redriver_preemph:3; /* 158+ */
467 u8 dp_onboard_redriver_vswing:3; /* 158+ */
468 u8 dp_onboard_redriver_present:1; /* 158+ */
470 u8 dp_ondock_redriver_preemph:3; /* 158+ */
471 u8 dp_ondock_redriver_vswing:3; /* 158+ */
472 u8 dp_ondock_redriver_present:1; /* 158+ */
474 u8 hdmi_level_shifter_value:5; /* 158+ */
475 u8 hdmi_max_data_rate:3; /* 204+ */
476 u16 dtd_buf_ptr; /* 161+ */
477 u8 edidless_efp:1; /* 161+ */
478 u8 compression_enable:1; /* 198+ */
479 u8 compression_method_cps:1; /* 198+ */
480 u8 ganged_edp:1; /* 202+ */
481 u8 lttpr_non_transparent:1; /* 235+ */
482 u8 disable_compression_for_ext_disp:1; /* 251+ */
484 u8 compression_structure_index:4; /* 198+ */
486 u8 hdmi_max_frl_rate:4; /* 237+ */
487 u8 hdmi_max_frl_rate_valid:1; /* 237+ */
488 u8 reserved4:3; /* 237+ */
494 u8 dvo_port; /* See DEVICE_PORT_* and DVO_PORT_* above */
499 u8 dvo_cfg; /* See DEVICE_CFG_* above */
509 u8 efp_routed:1; /* 158+ */
510 u8 lane_reversal:1; /* 184+ */
511 u8 lspcon:1; /* 192+ */
512 u8 iboost:1; /* 196+ */
513 u8 hpd_invert:1; /* 196+ */
514 u8 use_vbt_vswing:1; /* 218+ */
515 u8 dp_max_lane_count:2; /* 244+ */
516 u8 hdmi_support:1; /* 158+ */
517 u8 dp_support:1; /* 158+ */
518 u8 tmds_support:1; /* 158+ */
519 u8 support_reserved:5;
526 u8 sdvo_stall:1; /* 158+ */
528 u8 integrated_encoder:1;
529 u8 capabilities_reserved:2;
530 u8 dvo_wiring; /* See DEVICE_WIRE_* above */
534 u8 mipi_bridge_type; /* 171+ */
539 u8 dp_usb_type_c:1; /* 195+ */
541 u8 flags2_reserved:2; /* 195+ */
542 u8 dp_port_trace_length:4; /* 209+ */
543 u8 dp_gpio_index; /* 195+ */
544 u16 dp_gpio_pin_num; /* 195+ */
545 u8 dp_iboost_level:4; /* 196+ */
546 u8 hdmi_iboost_level:4; /* 196+ */
547 u8 dp_max_link_rate:3; /* 216+ */
548 u8 dp_max_link_rate_reserved:5; /* 216+ */
549 u8 efp_index; /* 256+ */
552 struct bdb_general_definitions {
554 u8 crt_ddc_gmbus_pin;
558 u8 skip_boot_crt_detect:1;
560 u8 rsvd1:5; /* finish byte */
562 /* boot device bits */
568 * If TV is present, it'll be at devices[0].
569 * LVDS will be next, either devices[0] or [1], if present.
570 * On some platforms the number of device is 6. But could be as few as
571 * 4 if both TV and LVDS are missing.
572 * And the device num is related with the size of general definition
573 * block. It is obtained by using the following formula:
574 * number = (block_size - sizeof(bdb_general_definitions))/
575 * defs->child_dev_size;
581 * Block 3 - Display Toggle Option Block
584 struct bdb_display_toggle {
586 u16 num_entries; /* ALM only */
587 u16 list[]; /* ALM only */
591 * Block 4 - Mode Support List
594 struct bdb_mode_support_list {
595 u8 intel_mode_number[0];
596 u16 mode_list_length;
600 * Block 5 - Generic Mode Table
603 struct generic_mode_table {
616 struct generic_mode_timings {
632 struct generic_mode_timings_alm {
633 struct generic_mode_timings timings;
642 struct bdb_generic_mode_table_alm {
643 struct generic_mode_table table;
644 struct generic_mode_timings_alm timings[3];
647 struct bdb_generic_mode_table_mgm {
649 struct generic_mode_table table;
650 struct generic_mode_timings timings[3];
654 * Block 6 - Extended MMIO Register Table, VBIOS only
655 * Block 7 - IO Software Flag Table, VBIOS only
656 * Block 8 - MMIO SWF Register Table, VBIOS only
658 struct bdb_reg_table {
662 * offset,value tuples:
663 * data_access_size==0xce -> u8,u8
664 * data_access_size==0x02 -> u32,u32
666 /* u16 table_end_marker; */
670 * Block 9 - Undocumented table (ALM only)
673 struct dot_clock_override_entry_gen2 {
684 struct bdb_dot_clock_override_alm {
685 struct dot_clock_override_entry_gen2 t[0];
689 * Block 9 - SRD Feature Block
694 u8 full_link:1; /* 165+ */
695 u8 require_aux_to_wakeup:1; /* 165+ */
696 u8 feature_bits_rsvd:6;
699 u8 idle_frames:4; /* 165+ */
700 u8 lines_to_wait:3; /* 165+ */
701 u8 wait_times_rsvd:1;
703 /* TP wake up time in multiple of 100 */
704 u16 tp1_wakeup_time; /* 165+ */
705 u16 tp2_tp3_wakeup_time; /* 165+ */
709 struct psr_table psr_table[16];
711 /* PSR2 TP2/TP3 wakeup time for 16 panels */
712 u32 psr2_tp2_tp3_wakeup_time; /* 226+ */
716 * Block 10 - Mode Removal Table
719 struct mode_removal_table {
728 struct bdb_mode_removal {
729 u8 row_size; /* 8 or 10 bytes */
731 * VBT spec says this is always 20 entries,
732 * but ALM seems to have only 15 entries.
734 struct mode_removal_table modes[];
735 /* u16 terminator; 0x0000 */
739 * Block 12 - Driver Features Data Block
742 #define BDB_DRIVER_FEATURE_NO_LVDS 0
743 #define BDB_DRIVER_FEATURE_INT_LVDS 1
744 #define BDB_DRIVER_FEATURE_SDVO_LVDS 2
745 #define BDB_DRIVER_FEATURE_INT_SDVO_LVDS 3
747 struct bdb_driver_features {
749 u8 boot_dev_algorithm:1;
750 u8 allow_display_switch_dvd:1;
751 u8 allow_display_switch_dos:1;
755 u8 sprite_in_clone:1;
761 u8 boot_mode_refresh;
763 /* Extended Driver Bits 1 */
764 u16 enable_lfp_primary:1;
765 u16 selective_mode_pruning:1;
766 u16 dual_frequency:1;
767 u16 render_clock_freq:1; /* 0: high freq; 1: low freq */
768 u16 nt_clone_support:1;
769 u16 power_scheme_ui:1; /* 0: CUI; 1: 3rd party */
770 u16 sprite_display_assign:1; /* 0: secondary; 1: primary */
771 u16 cui_aspect_scaling:1;
772 u16 preserve_aspect_ratio:1;
773 u16 sdvo_device_power_down:1;
780 u8 static_display:1; /* 163+ */
781 u8 embedded_platform:1; /* 163+ */
782 u8 display_subsystem_enable:1; /* 163+ */
785 u16 legacy_crt_max_x;
786 u16 legacy_crt_max_y;
787 u8 legacy_crt_max_refresh;
789 /* Extended Driver Bits 2 */
790 u8 hdmi_termination:1;
791 u8 cea861d_hdmi_support:1;
792 u8 self_refresh_enable:1;
795 u8 custom_vbt_version; /* 155+ */
797 /* Driver Feature Flags */
798 u16 rmpm_enabled:1; /* 159+ */
799 u16 s2ddt_enabled:1; /* 159+ */
800 u16 dpst_enabled:1; /* 159-227 */
801 u16 bltclt_enabled:1; /* 159+ */
802 u16 adb_enabled:1; /* 159-227 */
803 u16 drrs_enabled:1; /* 159-227 */
804 u16 grs_enabled:1; /* 159+ */
805 u16 gpmt_enabled:1; /* 159+ */
806 u16 tbt_enabled:1; /* 159+ */
807 u16 psr_enabled:1; /* 165-227 */
808 u16 ips_enabled:1; /* 165+ */
809 u16 dfps_enabled:1; /* 165+ */
810 u16 dmrrs_enabled:1; /* 174-227 */
811 u16 adt_enabled:1; /* ???-228 */
812 u16 hpd_wake:1; /* 201-240 */
813 u16 pc_feature_valid:1; /* 159+ */
817 * Block 13 - Driver Persistent Algorithm
820 struct bdb_driver_persistence {
821 u16 hotkey_persistent_algorithm:1;
822 u16 lid_switch_persistent_algorithm:1;
823 u16 power_management_persistent_algorithm:1;
824 u16 hotkey_persistent_on_mds_twin:1;
825 u16 hotkey_persistent_on_refresh_rate:1;
826 u16 hotkey_persistent_on_restore_pipe:1;
827 u16 hotkey_persistent_on_mode:1;
828 u16 edid_persistent_on_mode:1;
829 u16 dvo_hotplug_persistent_on_mode:1;
830 u16 docking_persistent_algorithm:1;
832 u8 persistent_max_config;
836 * Block 15 - Dot Clock Override Table
839 struct dot_clock_override_entry_gen3 {
848 struct bdb_dot_clock_override {
849 u8 row_size; /* 8 == gen2, 9 == gen3+ */
851 struct dot_clock_override_entry_gen3 table[]; /* or _gen2 */
855 * Block 16 - Toggle List Block (pre-HSW)
858 struct toggle_list_entry_old {
859 u8 display_select_pipe_a;
860 u8 display_select_pipe_b;
864 struct toggle_list_table_old {
867 struct toggle_list_entry_old list[];
870 struct bdb_display_select_old {
871 /* each table has variable size! */
872 struct toggle_list_table_old tables[4];
876 * Block 17 - SV Test Functions
879 struct bdb_sv_test_functions {
884 * Block 18 - Driver Rotation
887 struct bdb_driver_rotation {
890 u16 rotation_flags_2;
891 u32 rotation_flags_3;
892 u32 rotation_flags_4;
896 * Block 19 - Display Configuration Removal Table (pre-IVB)
899 struct display_remove_entry_old {
900 u8 display_select_pipe_a;
901 u8 display_select_pipe_b;
904 struct bdb_display_remove_old {
907 struct display_remove_entry_old table[];
911 * Block 20 - OEM Customizable Modes
915 u8 enable_in_vbios:1;
917 u8 enable_in_gop:1; /* 207+ */
919 u8 display_flags; /* ???-216 */
924 struct bdb_edid_dtd dtd;
925 u16 display_flags_2; /* 217+ */
928 struct bdb_oem_custom {
931 struct oem_mode modes[];
935 * Block 21 - EFP List
943 struct bdb_efp_list {
946 struct efp_entry efp[];
950 * Block 22 - SDVO LVDS General Options
953 struct bdb_sdvo_lvds_options {
955 u8 h40_set_panel_type;
960 u8 sclalarcoeff_tab_row_num;
961 u8 sclalarcoeff_tab_row_size;
963 u8 panel_misc_bits_1;
964 u8 panel_misc_bits_2;
965 u8 panel_misc_bits_3;
966 u8 panel_misc_bits_4;
970 * Block 23 - SDVO LVDS DTD
973 struct bdb_sdvo_lvds_dtd {
974 struct bdb_edid_dtd dtd[4];
978 * Block 24 - SDVO LVDS PnP ID
981 struct bdb_sdvo_lvds_pnp_id {
982 struct bdb_edid_pnp_id pnp_id[4];
986 * Block 25 - SDVO LVDS PPS
989 struct sdvo_lvds_pps {
990 u16 t0; /* power on */
991 u16 t1; /* backlight on */
992 u16 t2; /* backlight off */
993 u16 t3; /* power off */
994 u16 t4; /* power cycle */
997 struct bdb_sdvo_lvds_pps {
998 struct sdvo_lvds_pps pps[4];
1002 * Block 26 - TV Options Block
1005 struct bdb_tv_options {
1006 u16 underscan_overscan_hdtv_component:2;
1008 u16 underscan_overscan_hdtv_dvi:2;
1009 u16 add_modes_to_avoid_overscan_issue:1;
1010 u16 d_connector_support:1;
1014 * Block 27 - eDP VBT Block
1017 struct edp_power_seq {
1028 #define EDP_RATE_1_62 0
1029 #define EDP_RATE_2_7 1
1030 #define EDP_RATE_5_4 2
1031 #define EDP_LANE_1 0
1032 #define EDP_LANE_2 1
1033 #define EDP_LANE_4 3
1034 #define EDP_PREEMPHASIS_NONE 0
1035 #define EDP_PREEMPHASIS_3_5dB 1
1036 #define EDP_PREEMPHASIS_6dB 2
1037 #define EDP_PREEMPHASIS_9_5dB 3
1038 #define EDP_VSWING_0_4V 0
1039 #define EDP_VSWING_0_6V 1
1040 #define EDP_VSWING_0_8V 2
1041 #define EDP_VSWING_1_2V 3
1044 struct edp_fast_link_params {
1045 u8 rate:4; /* ???-223 */
1051 struct edp_pwm_delays {
1052 u16 pwm_on_to_backlight_enable;
1053 u16 backlight_disable_to_pwm_off;
1056 struct edp_full_link_params {
1061 struct edp_apical_params {
1063 u32 dpcd_base_address;
1064 u32 dpcd_idridix_control_0;
1065 u32 dpcd_option_select;
1068 u32 backlight_scale;
1072 struct edp_power_seq power_seqs[16];
1074 struct edp_fast_link_params fast_link_params[16];
1075 u32 sdrrs_msa_timing_delay;
1077 /* ith bit indicates enabled/disabled for (i+1)th panel */
1078 u16 edp_s3d_feature; /* 162+ */
1079 u16 edp_t3_optimization; /* 165+ */
1080 u64 edp_vswing_preemph; /* 173+ */
1081 u16 fast_link_training; /* 182+ */
1082 u16 dpcd_600h_write_required; /* 185+ */
1083 struct edp_pwm_delays pwm_delays[16]; /* 186+ */
1084 u16 full_link_params_provided; /* 199+ */
1085 struct edp_full_link_params full_link_params[16]; /* 199+ */
1086 u16 apical_enable; /* 203+ */
1087 struct edp_apical_params apical_params[16]; /* 203+ */
1088 u16 edp_fast_link_training_rate[16]; /* 224+ */
1089 u16 edp_max_port_link_rate[16]; /* 244+ */
1090 u16 edp_dsc_disable; /* 251+ */
1091 u16 t6_delay_support; /* 260+ */
1092 u16 link_idle_time[16]; /* 260+ */
1096 * Block 28 - EFP DTD Block
1099 struct bdb_efp_dtd {
1100 struct bdb_edid_dtd dtd[3];
1104 * Block 29 - Toggle List Block (IVB)
1107 struct toggle_list_entry_ivb {
1111 struct toggle_list_table_ivb {
1114 struct toggle_list_entry_ivb list[];
1117 struct bdb_display_select_ivb {
1118 /* each table has variable size! */
1119 struct toggle_list_table_ivb tables[4];
1123 * Block 30 - Display Configuration Removal Table (IVB)
1126 struct display_remove_entry_ivb {
1130 struct bdb_display_remove_ivb {
1133 struct display_remove_entry_ivb table[];
1137 * Block 31 - Toggle List Block (HSW+)
1140 struct toggle_list_entry_hsw {
1144 struct toggle_list_table_hsw {
1147 struct toggle_list_entry_hsw list[];
1150 struct bdb_display_select_hsw {
1151 /* each table has variable size! */
1152 struct toggle_list_table_hsw tables[4];
1156 * Block 32 - Display Configuration Removal Table (HSW+)
1159 struct display_remove_entry_hsw {
1163 struct bdb_display_remove_hsw {
1166 struct display_remove_entry_hsw table[];
1170 * Block 40 - LFP Data Block
1173 struct bdb_lfp_options {
1175 u8 panel_type2; /* 212+ */
1176 /* LVDS capabilities, stored in a dword */
1178 u8 pfit_text_mode_enhanced:1;
1179 u8 pfit_gfx_mode_enhanced:1;
1180 u8 pfit_ratio_auto:1;
1182 u8 lvds_edid:1; /* ???-240 */
1185 /* LVDS Panel channel bits stored here */
1186 u32 lvds_panel_channel_bits;
1187 /* LVDS SSC (Spread Spectrum Clock) bits stored here. */
1191 /* Panel color depth defined here */
1192 u16 panel_color_depth;
1193 /* LVDS panel type bits stored here */
1194 u32 dps_panel_type_bits;
1195 /* LVDS backlight control type bits stored here */
1196 u32 blt_control_type_bits; /* ???-240 */
1198 u16 lcdvcc_s0_enable; /* 200+ */
1199 u32 rotation; /* 228+ */
1200 u32 position; /* 240+ */
1204 * Block 41 - LFP Data Table Pointers
1206 struct lfp_data_ptr_table {
1207 u16 offset; /* offsets are from start of bdb */
1211 /* LFP pointer table contains entries to the struct below */
1212 struct lfp_data_ptr {
1213 struct lfp_data_ptr_table fp_timing;
1214 struct lfp_data_ptr_table dvo_timing;
1215 struct lfp_data_ptr_table panel_pnp_id;
1218 struct bdb_lfp_data_ptrs {
1220 struct lfp_data_ptr ptr[16];
1221 struct lfp_data_ptr_table panel_name; /* (156-163?)+ */
1225 * Block 42 - LFP Data Tables
1228 /* LFP data has 3 blocks per entry */
1239 u32 pp_cycle_reg_val;
1246 * For reference only. fp_timing has variable size so
1247 * the data must be accessed using the data table pointers.
1248 * Do not use this directly!
1250 struct lfp_data_entry {
1251 struct fp_timing fp_timing;
1252 struct bdb_edid_dtd dvo_timing;
1253 struct bdb_edid_pnp_id pnp_id;
1256 struct bdb_lfp_data {
1257 struct lfp_data_entry data[16];
1260 struct lfp_black_border {
1262 u8 bottom; /* 227+ */
1264 u8 right; /* 238+ */
1267 struct bdb_lfp_data_tail {
1268 struct bdb_edid_product_name panel_name[16]; /* (156-163?)+ */
1269 u16 scaling_enable; /* 187+ */
1270 u8 seamless_drrs_min_refresh_rate[16]; /* 188+ */
1271 u8 pixel_overlap_count[16]; /* 208+ */
1272 struct lfp_black_border black_border[16]; /* 227+ */
1273 u16 dual_lfp_port_sync_enable; /* 231+ */
1274 u16 gpu_dithering_for_banding_artifacts; /* 245+ */
1278 * Block 43 - LFP Backlight Control Data Block
1281 #define BDB_BACKLIGHT_TYPE_NONE 0
1282 #define BDB_BACKLIGHT_TYPE_PWM 2
1284 struct lfp_backlight_data_entry {
1286 u8 active_low_pwm:1;
1287 u8 i2c_pin:3; /* obsolete since ? */
1288 u8 i2c_speed:2; /* obsolete since ? */
1290 u8 min_brightness; /* ???-233 */
1291 u8 i2c_address; /* obsolete since ? */
1292 u8 i2c_command; /* obsolete since ? */
1295 struct lfp_backlight_control_method {
1300 struct lfp_brightness_level {
1305 struct bdb_lfp_backlight {
1307 struct lfp_backlight_data_entry data[16];
1308 u8 level[16]; /* 162-233 */
1309 struct lfp_backlight_control_method backlight_control[16]; /* 191+ */
1310 struct lfp_brightness_level brightness_level[16]; /* 234+ */
1311 struct lfp_brightness_level brightness_min_level[16]; /* 234+ */
1312 u8 brightness_precision_bits[16]; /* 236+ */
1313 u16 hdr_dpcd_refresh_timeout[16]; /* 239+ */
1317 * Block 44 - LFP Power Conservation Features Block
1319 struct lfp_power_features {
1320 u8 dpst_support:1; /* ???-159 */
1321 u8 power_conservation_pref:3;
1323 u8 lace_enabled_status:1; /* 210+ */
1324 u8 lace_support:1; /* 210+ */
1328 struct als_data_entry {
1329 u16 backlight_adjust;
1333 struct aggressiveness_profile_entry {
1334 u8 dpst_aggressiveness : 4; /* (228/252)-256 */
1335 u8 lace_aggressiveness : 4;
1338 struct aggressiveness_profile2_entry {
1339 u8 opst_aggressiveness : 4;
1340 u8 elp_aggressiveness : 4;
1343 struct aggressiveness_profile3_entry {
1344 u8 apd_aggressiveness:4;
1345 u8 pixoptix_aggressiveness:4;
1348 struct aggressiveness_profile4_entry {
1349 u8 xpst_aggressiveness:4;
1350 u8 tcon_aggressiveness:4;
1353 struct panel_identification {
1354 u8 panel_technology:4;
1358 struct bdb_lfp_power {
1359 struct lfp_power_features features; /* ???-227 */
1360 struct als_data_entry als[5];
1361 u8 lace_aggressiveness_profile:3; /* 210-227 */
1363 u16 dpst; /* 228-256 */
1365 u16 drrs; /* 228+ */
1366 u16 lace_support; /* 228+ */
1368 u16 dmrrs; /* 228+ */
1370 u16 lace_enabled_status; /* 228+ */
1371 struct aggressiveness_profile_entry aggressiveness[16];
1372 u16 hobl; /* 232+ */
1373 u16 vrr_feature_enabled; /* 233+ */
1374 u16 elp; /* 247-256 */
1375 u16 opst; /* 247-256 */
1376 struct aggressiveness_profile2_entry aggressiveness2[16]; /* 247-256 */
1377 u16 apd; /* 253-256 */
1378 u16 pixoptix; /* 253-256 */
1379 struct aggressiveness_profile3_entry aggressiveness3[16]; /* 253-256 */
1380 struct panel_identification panel_identification[16]; /* 257+ */
1381 u16 xpst_support; /* 257+ */
1382 u16 tcon_based_backlight_optimization; /* 257+ */
1383 struct aggressiveness_profile4_entry aggressiveness4[16]; /* 257+ */
1384 u16 tcon_backlight_xpst_coexistence; /* 257+ */
1388 * Block 45 - eDP BFI Block
1392 u8 enable_bfi_in_driver:1;
1393 u8 enable_brightness_control_in_cui:1;
1395 u8 brightness_percentage_when_bfi_disabled;
1398 struct bdb_edp_bfi {
1399 u8 bfi_structure_size;
1400 struct edp_bfi bfi[16];
1404 * Block 46 - Chromaticity For Narrow Gamut Panel Configuration Block
1407 struct chromaticity {
1408 u8 chromaticity_enable:1;
1409 u8 chromaticity_from_edid_base_block:1;
1431 struct luminance_and_gamma {
1432 u8 luminance_enable:1; /* 211+ */
1433 u8 gamma_enable:1; /* 211+ */
1436 u16 min_luminance; /* 211+ */
1437 u16 max_luminance; /* 211+ */
1438 u16 one_percent_max_luminance; /* 211+ */
1439 u8 gamma; /* 211+ */
1442 struct bdb_chromaticity {
1443 struct chromaticity chromaticity[16];
1444 struct luminance_and_gamma luminance_and_gamma[16]; /* 211+ */
1448 * Block 50 - MIPI Block
1452 u16 panel_identifier;
1453 u16 bridge_revision;
1456 u32 pixel_format_18bpp:1;
1458 u32 dphy_params_valid:1;
1467 u16 virtual_channel_num:2;
1468 u16 video_transfer_mode:2;
1472 u32 renesas_bridge_ref_clock;
1473 u16 power_conservation;
1475 u32 prepare_count:5;
1477 u32 clk_zero_count:8;
1480 u32 exit_zero_count:6;
1483 u32 high_low_switch_count;
1485 u32 clock_lane_switch_time_counter;
1486 u32 panel_color_depth;
1490 struct mipi_data mipi[16];
1494 * Block 51 - Fixed Set Mode Table
1497 struct bdb_fixed_set_mode {
1504 * Block 52 - MIPI Configuration Block
1507 #define MAX_MIPI_CONFIGURATIONS 6
1509 struct bdb_mipi_config {
1510 struct mipi_config config[MAX_MIPI_CONFIGURATIONS]; /* 175+ */
1511 struct mipi_pps_data pps[MAX_MIPI_CONFIGURATIONS]; /* 177+ */
1512 struct edp_pwm_delays pwm_delays[MAX_MIPI_CONFIGURATIONS]; /* 186+ */
1513 u8 pmic_i2c_bus_number[MAX_MIPI_CONFIGURATIONS]; /* 190+ */
1517 * Block 53 - MIPI Sequence Block
1520 struct bdb_mipi_sequence {
1522 u8 data[]; /* up to 6 variable length blocks */
1526 * Block 55 - RGB Palette Table
1529 struct bdb_rgb_palette {
1537 * Block 56 - Compression Parameters
1540 #define VBT_RC_BUFFER_BLOCK_SIZE_1KB 0
1541 #define VBT_RC_BUFFER_BLOCK_SIZE_4KB 1
1542 #define VBT_RC_BUFFER_BLOCK_SIZE_16KB 2
1543 #define VBT_RC_BUFFER_BLOCK_SIZE_64KB 3
1545 #define VBT_DSC_LINE_BUFFER_DEPTH(vbt_value) ((vbt_value) + 8) /* bits */
1546 #define VBT_DSC_MAX_BPP(vbt_value) (6 + (vbt_value) * 2)
1548 struct dsc_compression_parameters_entry {
1552 u8 rc_buffer_block_size:2;
1556 * Buffer size in bytes:
1558 * 4 ^ rc_buffer_block_size * 1024 * (rc_buffer_size + 1) bytes
1561 u32 slices_per_line;
1563 u8 line_buffer_depth:4;
1567 u8 block_prediction_enable:1;
1570 u8 max_bpp; /* mapping */
1572 /* Color depth capabilities */
1582 struct bdb_compression_parameters {
1584 struct dsc_compression_parameters_entry data[16];
1588 * Block 57 - Vswing PreEmphasis Table
1591 struct bdb_vswing_preemph {
1598 * Block 58 - Generic DTD Block
1601 struct generic_dtd_entry {
1616 u8 vsync_positive_polarity:1;
1617 u8 hsync_positive_polarity:1;
1622 struct bdb_generic_dtd {
1624 struct generic_dtd_entry dtd[]; /* up to 24 DTD's */
1628 * Block 253 - PRD Table
1631 struct prd_entry_old {
1632 u8 displays_attached;
1633 u8 display_in_pipe_a;
1634 u8 display_in_pipe_b;
1637 struct bdb_prd_table_old {
1638 struct prd_entry_old list[0]; /* ???-216 */
1639 u16 num_entries; /* ???-216 */
1642 struct prd_entry_new {
1643 u16 primary_display;
1644 u16 secondary_display;
1647 struct bdb_prd_table_new {
1648 u16 num_entries; /* 217+ */
1649 struct prd_entry_new list[]; /* 217+ */
1652 #endif /* _INTEL_VBT_DEFS_H_ */