linux/drivers/gpu/drm/i915/display/intel_vbt_defs.h

/*
 * Copyright © 2006-2016 Intel Corporation
 *
 * 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 (including the next
 * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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:
 *    Eric Anholt <[email protected]>
 *
 */

/*
 * This information is private to VBT parsing in intel_bios.c.
 *
 * Please do NOT include anywhere else.
 */
#ifndef _INTEL_BIOS_PRIVATE
#error "intel_vbt_defs.h is private to intel_bios.c"
#endif

#ifndef _INTEL_VBT_DEFS_H_
#define _INTEL_VBT_DEFS_H_

#include "intel_bios.h"

/* EDID derived structures */
struct bdb_edid_pnp_id {} __packed;

struct bdb_edid_product_name {} __packed;

struct bdb_edid_dtd {} __packed;

/**
 * struct vbt_header - VBT Header structure
 * @signature:		VBT signature, always starts with "$VBT"
 * @version:		Version of this structure
 * @header_size:	Size of this structure
 * @vbt_size:		Size of VBT (VBT Header, BDB Header and data blocks)
 * @vbt_checksum:	Checksum
 * @reserved0:		Reserved
 * @bdb_offset:		Offset of &struct bdb_header from beginning of VBT
 * @aim_offset:		Offsets of add-in data blocks from beginning of VBT
 */
struct vbt_header {} __packed;

/**
 * struct bdb_header - BDB Header structure
 * @signature:		BDB signature "BIOS_DATA_BLOCK"
 * @version:		Version of the data block definitions
 * @header_size:	Size of this structure
 * @bdb_size:		Size of BDB (BDB Header and data blocks)
 */
struct bdb_header {} __packed;

/*
 * BDB version number dependencies are documented as:
 *
 * <start>+
 *    indicates the field was introduced in version <start>
 *    and is still valid
 *
 * <start>-<end>
 *    indicates the field was introduced in version <start>
 *    and obsoleted in version <end>+1.
 *
 * ??? indicates the specific version number is unknown
 */

/*
 * There are several types of BIOS data blocks (BDBs), each block has
 * an ID and size in the first 3 bytes (ID in first, size in next 2).
 * Known types are listed below.
 */
enum bdb_block_id {};

/*
 * Block 1 - General Bit Definitions
 */

struct bdb_general_features {} __packed;

/*
 * Block 2 - General Bytes Definition
 */

/* pre-915 */
#define GPIO_PIN_DVI_LVDS
#define GPIO_PIN_ADD_I2C
#define GPIO_PIN_ADD_DDC
#define GPIO_PIN_ADD_DDC_I2C

/* Device handle */
#define DEVICE_HANDLE_CRT
#define DEVICE_HANDLE_TV
#define DEVICE_HANDLE_EFP1
#define DEVICE_HANDLE_EFP2
#define DEVICE_HANDLE_EFP3
#define DEVICE_HANDLE_EFP4
#define DEVICE_HANDLE_EFP5
#define DEVICE_HANDLE_EFP6
#define DEVICE_HANDLE_EFP7
#define DEVICE_HANDLE_EFP8
#define DEVICE_HANDLE_LFP1
#define DEVICE_HANDLE_LFP2

/* Pre 915 */
#define DEVICE_TYPE_NONE
#define DEVICE_TYPE_CRT
#define DEVICE_TYPE_TV
#define DEVICE_TYPE_EFP
#define DEVICE_TYPE_LFP
/* On 915+ */
#define DEVICE_TYPE_CRT_DPMS
#define DEVICE_TYPE_CRT_DPMS_HOTPLUG
#define DEVICE_TYPE_TV_COMPOSITE
#define DEVICE_TYPE_TV_MACROVISION
#define DEVICE_TYPE_TV_RF_COMPOSITE
#define DEVICE_TYPE_TV_SVIDEO_COMPOSITE
#define DEVICE_TYPE_TV_SCART
#define DEVICE_TYPE_TV_CODEC_HOTPLUG_PWR
#define DEVICE_TYPE_EFP_HOTPLUG_PWR
#define DEVICE_TYPE_EFP_DVI_HOTPLUG_PWR
#define DEVICE_TYPE_EFP_DVI_I
#define DEVICE_TYPE_EFP_DVI_D_DUAL
#define DEVICE_TYPE_EFP_DVI_D_HDCP
#define DEVICE_TYPE_OPENLDI_HOTPLUG_PWR
#define DEVICE_TYPE_OPENLDI_DUALPIX
#define DEVICE_TYPE_LFP_PANELLINK
#define DEVICE_TYPE_LFP_CMOS_PWR
#define DEVICE_TYPE_LFP_LVDS_PWR
#define DEVICE_TYPE_LFP_LVDS_DUAL
#define DEVICE_TYPE_LFP_LVDS_DUAL_HDCP

/* Add the device class for LFP, TV, HDMI */
#define DEVICE_TYPE_INT_LFP
#define DEVICE_TYPE_INT_TV
#define DEVICE_TYPE_HDMI
#define DEVICE_TYPE_DP
#define DEVICE_TYPE_DP_DUAL_MODE
#define DEVICE_TYPE_eDP

#define DEVICE_TYPE_CLASS_EXTENSION
#define DEVICE_TYPE_POWER_MANAGEMENT
#define DEVICE_TYPE_HOTPLUG_SIGNALING
#define DEVICE_TYPE_INTERNAL_CONNECTOR
#define DEVICE_TYPE_NOT_HDMI_OUTPUT
#define DEVICE_TYPE_MIPI_OUTPUT
#define DEVICE_TYPE_COMPOSITE_OUTPUT
#define DEVICE_TYPE_DUAL_CHANNEL
#define DEVICE_TYPE_HIGH_SPEED_LINK
#define DEVICE_TYPE_LVDS_SIGNALING
#define DEVICE_TYPE_TMDS_DVI_SIGNALING
#define DEVICE_TYPE_VIDEO_SIGNALING
#define DEVICE_TYPE_DISPLAYPORT_OUTPUT
#define DEVICE_TYPE_DIGITAL_OUTPUT
#define DEVICE_TYPE_ANALOG_OUTPUT

#define DEVICE_CFG_NONE
#define DEVICE_CFG_12BIT_DVOB
#define DEVICE_CFG_12BIT_DVOC
#define DEVICE_CFG_24BIT_DVOBC
#define DEVICE_CFG_24BIT_DVOCB
#define DEVICE_CFG_DUAL_DVOB
#define DEVICE_CFG_DUAL_DVOC
#define DEVICE_CFG_DUAL_DVOBC
#define DEVICE_CFG_DUAL_LINK_DVOBC
#define DEVICE_CFG_DUAL_LINK_DVOCB

#define DEVICE_WIRE_NONE
#define DEVICE_WIRE_DVOB
#define DEVICE_WIRE_DVOC
#define DEVICE_WIRE_DVOBC
#define DEVICE_WIRE_DVOBB
#define DEVICE_WIRE_DVOCC
#define DEVICE_WIRE_DVOB_MASTER
#define DEVICE_WIRE_DVOC_MASTER

/* dvo_port pre BDB 155 */
#define DEVICE_PORT_DVOA
#define DEVICE_PORT_DVOB
#define DEVICE_PORT_DVOC

/* dvo_port BDB 155+ */
#define DVO_PORT_HDMIA
#define DVO_PORT_HDMIB
#define DVO_PORT_HDMIC
#define DVO_PORT_HDMID
#define DVO_PORT_LVDS
#define DVO_PORT_TV
#define DVO_PORT_CRT
#define DVO_PORT_DPB
#define DVO_PORT_DPC
#define DVO_PORT_DPD
#define DVO_PORT_DPA
#define DVO_PORT_DPE
#define DVO_PORT_HDMIE
#define DVO_PORT_DPF
#define DVO_PORT_HDMIF
#define DVO_PORT_DPG
#define DVO_PORT_HDMIG
#define DVO_PORT_DPH
#define DVO_PORT_HDMIH
#define DVO_PORT_DPI
#define DVO_PORT_HDMII
#define DVO_PORT_MIPIA
#define DVO_PORT_MIPIB
#define DVO_PORT_MIPIC
#define DVO_PORT_MIPID

#define HDMI_MAX_DATA_RATE_PLATFORM
#define HDMI_MAX_DATA_RATE_297
#define HDMI_MAX_DATA_RATE_165
#define HDMI_MAX_DATA_RATE_594
#define HDMI_MAX_DATA_RATE_340
#define HDMI_MAX_DATA_RATE_300

#define LEGACY_CHILD_DEVICE_CONFIG_SIZE

/* DDC Bus DDI Type 155+ */
enum vbt_gmbus_ddi {};

#define DP_AUX_A
#define DP_AUX_B
#define DP_AUX_C
#define DP_AUX_D
#define DP_AUX_E
#define DP_AUX_F
#define DP_AUX_G
#define DP_AUX_H
#define DP_AUX_I

/* DP max link rate 216+ */
#define BDB_216_VBT_DP_MAX_LINK_RATE_HBR3
#define BDB_216_VBT_DP_MAX_LINK_RATE_HBR2
#define BDB_216_VBT_DP_MAX_LINK_RATE_HBR
#define BDB_216_VBT_DP_MAX_LINK_RATE_LBR

/* DP max link rate 230+ */
#define BDB_230_VBT_DP_MAX_LINK_RATE_DEF
#define BDB_230_VBT_DP_MAX_LINK_RATE_LBR
#define BDB_230_VBT_DP_MAX_LINK_RATE_HBR
#define BDB_230_VBT_DP_MAX_LINK_RATE_HBR2
#define BDB_230_VBT_DP_MAX_LINK_RATE_HBR3
#define BDB_230_VBT_DP_MAX_LINK_RATE_UHBR10
#define BDB_230_VBT_DP_MAX_LINK_RATE_UHBR13P5
#define BDB_230_VBT_DP_MAX_LINK_RATE_UHBR20

/*
 * The child device config, aka the display device data structure, provides a
 * description of a port and its configuration on the platform.
 *
 * The child device config size has been increased, and fields have been added
 * and their meaning has changed over time. Care must be taken when accessing
 * basically any of the fields to ensure the correct interpretation for the BDB
 * version in question.
 *
 * When we copy the child device configs to dev_priv->display.vbt.child_dev, we
 * reserve space for the full structure below, and initialize the tail not
 * actually present in VBT to zeros. Accessing those fields is fine, as long as
 * the default zero is taken into account, again according to the BDB version.
 *
 * BDB versions 155 and below are considered legacy, and version 155 seems to be
 * a baseline for some of the VBT documentation. When adding new fields, please
 * include the BDB version when the field was added, if it's above that.
 */
struct child_device_config {} __packed;

struct bdb_general_definitions {} __packed;

/*
 * Block 3 - Display Toggle Option Block
 */

struct bdb_display_toggle {} __packed;

/*
 * Block 4 - Mode Support List
 */

struct bdb_mode_support_list {} __packed;

/*
 * Block 5 - Generic Mode Table
 */

struct generic_mode_table {} __packed;

struct generic_mode_timings {} __packed;

struct generic_mode_timings_alm {} __packed;

struct bdb_generic_mode_table_alm {} __packed;

struct bdb_generic_mode_table_mgm {} __packed;

/*
 * Block 6 - Extended MMIO Register Table, VBIOS only
 * Block 7 - IO Software Flag Table, VBIOS only
 * Block 8 - MMIO SWF Register Table, VBIOS only
 */
struct bdb_reg_table {} __packed;

/*
 * Block 9 - Undocumented table (ALM only)
 */

struct dot_clock_override_entry_gen2 {} __packed;

struct bdb_dot_clock_override_alm {} __packed;

/*
 * Block 9 - SRD Feature Block
 */

struct psr_table {} __packed;

struct bdb_psr {} __packed;

/*
 * Block 10 - Mode Removal Table
 */

struct mode_removal_table {} __packed;

struct bdb_mode_removal {} __packed;

/*
 * Block 12 - Driver Features Data Block
 */

#define BDB_DRIVER_FEATURE_NO_LVDS
#define BDB_DRIVER_FEATURE_INT_LVDS
#define BDB_DRIVER_FEATURE_SDVO_LVDS
#define BDB_DRIVER_FEATURE_INT_SDVO_LVDS

struct bdb_driver_features {} __packed;

/*
 * Block 13 - Driver Persistent Algorithm
 */

struct bdb_driver_persistence {} __packed;

/*
 * Block 15 - Dot Clock Override Table
 */

struct dot_clock_override_entry_gen3 {} __packed;

struct bdb_dot_clock_override {} __packed;

/*
 * Block 16 - Toggle List Block (pre-HSW)
 */

struct toggle_list_entry_old {} __packed;

struct toggle_list_table_old {} __packed;

struct bdb_display_select_old {} __packed;

/*
 * Block 17 - SV Test Functions
 */

struct bdb_sv_test_functions {} __packed;

/*
 * Block 18 - Driver Rotation
 */

struct bdb_driver_rotation {} __packed;

/*
 * Block 19 - Display Configuration Removal Table (pre-IVB)
 */

struct display_remove_entry_old {} __packed;

struct bdb_display_remove_old {} __packed;

/*
 * Block 20 - OEM Customizable Modes
 */

struct oem_mode {} __packed;

struct bdb_oem_custom {} __packed;

/*
 * Block 21 - EFP List
 */

struct efp_entry {} __packed;

struct bdb_efp_list {} __packed;

/*
 * Block 22 - SDVO LVDS General Options
 */

struct bdb_sdvo_lvds_options {} __packed;

/*
 * Block 23 - SDVO LVDS DTD
 */

struct bdb_sdvo_lvds_dtd {} __packed;

/*
 * Block 24 - SDVO LVDS PnP ID
 */

struct bdb_sdvo_lvds_pnp_id {} __packed;

/*
 * Block 25 - SDVO LVDS PPS
 */

struct sdvo_lvds_pps {} __packed;

struct bdb_sdvo_lvds_pps {} __packed;

/*
 * Block 26 - TV Options Block
 */

struct bdb_tv_options {} __packed;

/*
 * Block 27 - eDP VBT Block
 */

#define EDP_18BPP
#define EDP_24BPP
#define EDP_30BPP
#define EDP_RATE_1_62
#define EDP_RATE_2_7
#define EDP_RATE_5_4
#define EDP_LANE_1
#define EDP_LANE_2
#define EDP_LANE_4
#define EDP_PREEMPHASIS_NONE
#define EDP_PREEMPHASIS_3_5dB
#define EDP_PREEMPHASIS_6dB
#define EDP_PREEMPHASIS_9_5dB
#define EDP_VSWING_0_4V
#define EDP_VSWING_0_6V
#define EDP_VSWING_0_8V
#define EDP_VSWING_1_2V


struct edp_fast_link_params {} __packed;

struct edp_pwm_delays {} __packed;

struct edp_full_link_params {} __packed;

struct edp_apical_params {} __packed;

struct bdb_edp {} __packed;

/*
 * Block 28 - EFP DTD Block
 */

struct bdb_efp_dtd {} __packed;

/*
 * Block 29 - Toggle List Block (IVB)
 */

struct toggle_list_entry_ivb {} __packed;

struct toggle_list_table_ivb {} __packed;

struct bdb_display_select_ivb {} __packed;

/*
 * Block 30 - Display Configuration Removal Table (IVB)
 */

struct display_remove_entry_ivb {} __packed;

struct bdb_display_remove_ivb {} __packed;

/*
 * Block 31 - Toggle List Block (HSW+)
 */

struct toggle_list_entry_hsw {} __packed;

struct toggle_list_table_hsw {} __packed;

struct bdb_display_select_hsw {} __packed;

/*
 * Block 32 - Display Configuration Removal Table (HSW+)
 */

struct display_remove_entry_hsw {} __packed;

struct bdb_display_remove_hsw {} __packed;

/*
 * Block 40 - LFP Data Block
 */

struct bdb_lfp_options {} __packed;

/*
 * Block 41 - LFP Data Table Pointers
 */
struct lfp_data_ptr_table {} __packed;

/* LFP pointer table contains entries to the struct below */
struct lfp_data_ptr {} __packed;

struct bdb_lfp_data_ptrs {} __packed;

/*
 * Block 42 - LFP Data Tables
 */

/* LFP data has 3 blocks per entry */
struct fp_timing {} __packed;

/*
 * For reference only. fp_timing has variable size so
 * the data must be accessed using the data table pointers.
 * Do not use this directly!
 */
struct lfp_data_entry {} __packed;

struct bdb_lfp_data {} __packed;

struct lfp_black_border {} __packed;

struct bdb_lfp_data_tail {} __packed;

/*
 * Block 43 - LFP Backlight Control Data Block
 */

#define BDB_BACKLIGHT_TYPE_NONE
#define BDB_BACKLIGHT_TYPE_PWM

struct lfp_backlight_data_entry {} __packed;

struct lfp_backlight_control_method {} __packed;

struct lfp_brightness_level {} __packed;

struct bdb_lfp_backlight {} __packed;

/*
 * Block 44 - LFP Power Conservation Features Block
 */
struct lfp_power_features {} __packed;

struct als_data_entry {} __packed;

struct aggressiveness_profile_entry {} __packed;

struct aggressiveness_profile2_entry {} __packed;

struct aggressiveness_profile3_entry {} __packed;

struct aggressiveness_profile4_entry {} __packed;

struct panel_identification {} __packed;

struct bdb_lfp_power {} __packed;

/*
 * Block 45 - eDP BFI Block
 */

struct edp_bfi {} __packed;

struct bdb_edp_bfi {} __packed;

/*
 * Block 46 - Chromaticity For Narrow Gamut Panel Configuration Block
 */

struct chromaticity {} __packed;

struct luminance_and_gamma {} __packed;

struct bdb_chromaticity {} __packed;

/*
 * Block 50 - MIPI Block
 */

struct mipi_data {} __packed;

struct bdb_mipi {} __packed;

/*
 * Block 51 - Fixed Set Mode Table
 */

struct bdb_fixed_set_mode {} __packed;

/*
 * Block 52 - MIPI Configuration Block
 */

#define MAX_MIPI_CONFIGURATIONS

struct bdb_mipi_config {} __packed;

/*
 * Block 53 - MIPI Sequence Block
 */

struct bdb_mipi_sequence {} __packed;

/*
 * Block 55 - RGB Palette Table
 */

struct bdb_rgb_palette {} __packed;

/*
 * Block 56 - Compression Parameters
 */

#define VBT_RC_BUFFER_BLOCK_SIZE_1KB
#define VBT_RC_BUFFER_BLOCK_SIZE_4KB
#define VBT_RC_BUFFER_BLOCK_SIZE_16KB
#define VBT_RC_BUFFER_BLOCK_SIZE_64KB

#define VBT_DSC_LINE_BUFFER_DEPTH(vbt_value)
#define VBT_DSC_MAX_BPP(vbt_value)

struct dsc_compression_parameters_entry {} __packed;

struct bdb_compression_parameters {} __packed;

/*
 * Block 57 -  Vswing PreEmphasis Table
 */

struct bdb_vswing_preemph {} __packed;

/*
 * Block 58 - Generic DTD Block
 */

struct generic_dtd_entry {} __packed;

struct bdb_generic_dtd {} __packed;

/*
 * Block 253 - PRD Table
 */

struct prd_entry_old {} __packed;

struct bdb_prd_table_old {} __packed;

struct prd_entry_new {} __packed;

struct bdb_prd_table_new {} __packed;

#endif /* _INTEL_VBT_DEFS_H_ */