]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/gpu/drm/i915/intel_vbt_defs.h
drm/i915/bios: amend child device flags based on intel_vbt_decode
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / i915 / intel_vbt_defs.h
index fc67b2ed6a20389a7c818f01d6c1c540de2edd92..6a5d2a804d52ac5b97c1c8b35b4a3d34d4fa4fd7 100644 (file)
@@ -149,16 +149,19 @@ struct bdb_general_features {
        u8 ssc_freq:1;
        u8 enable_lfp_on_override:1;
        u8 disable_ssc_ddt:1;
-       u8 rsvd7:1;
+       u8 underscan_vga_timings:1;
        u8 display_clock_mode:1;
-       u8 rsvd8:1; /* finish byte */
+       u8 vbios_hotplug_support:1;
 
         /* bits 3 */
        u8 disable_smooth_vision:1;
        u8 single_dvi:1;
-       u8 rsvd9:1;
+       u8 rotate_180:1;                                        /* 181 */
        u8 fdi_rx_polarity_inverted:1;
-       u8 rsvd10:4; /* finish byte */
+       u8 vbios_extended_mode:1;                               /* 160 */
+       u8 copy_ilfp_dtd_to_sdvo_lvds_dtd:1;                    /* 160 */
+       u8 panel_best_fit_timing:1;                             /* 160 */
+       u8 ignore_strap_state:1;                                /* 160 */
 
         /* bits 4 */
        u8 legacy_monitor_detect;
@@ -167,9 +170,10 @@ struct bdb_general_features {
        u8 int_crt_support:1;
        u8 int_tv_support:1;
        u8 int_efp_support:1;
-       u8 dp_ssc_enb:1;        /* PCH attached eDP supports SSC */
+       u8 dp_ssc_enable:1;     /* PCH attached eDP supports SSC */
        u8 dp_ssc_freq:1;       /* SSC freq for PCH attached eDP */
-       u8 rsvd11:3; /* finish byte */
+       u8 dp_ssc_dongle_supported:1;
+       u8 rsvd11:2; /* finish byte */
 } __packed;
 
 /* pre-915 */
@@ -206,6 +210,56 @@ struct bdb_general_features {
 #define DEVICE_TYPE_LFP_LVDS_DUAL      0x5162
 #define DEVICE_TYPE_LFP_LVDS_DUAL_HDCP 0x51e2
 
+/* Add the device class for LFP, TV, HDMI */
+#define DEVICE_TYPE_INT_LFP            0x1022
+#define DEVICE_TYPE_INT_TV             0x1009
+#define DEVICE_TYPE_HDMI               0x60D2
+#define DEVICE_TYPE_DP                 0x68C6
+#define DEVICE_TYPE_DP_DUAL_MODE       0x60D6
+#define DEVICE_TYPE_eDP                        0x78C6
+
+#define DEVICE_TYPE_CLASS_EXTENSION    (1 << 15)
+#define DEVICE_TYPE_POWER_MANAGEMENT   (1 << 14)
+#define DEVICE_TYPE_HOTPLUG_SIGNALING  (1 << 13)
+#define DEVICE_TYPE_INTERNAL_CONNECTOR (1 << 12)
+#define DEVICE_TYPE_NOT_HDMI_OUTPUT    (1 << 11)
+#define DEVICE_TYPE_MIPI_OUTPUT                (1 << 10)
+#define DEVICE_TYPE_COMPOSITE_OUTPUT   (1 << 9)
+#define DEVICE_TYPE_DUAL_CHANNEL       (1 << 8)
+#define DEVICE_TYPE_HIGH_SPEED_LINK    (1 << 6)
+#define DEVICE_TYPE_LVDS_SINGALING     (1 << 5)
+#define DEVICE_TYPE_TMDS_DVI_SIGNALING (1 << 4)
+#define DEVICE_TYPE_VIDEO_SIGNALING    (1 << 3)
+#define DEVICE_TYPE_DISPLAYPORT_OUTPUT (1 << 2)
+#define DEVICE_TYPE_DIGITAL_OUTPUT     (1 << 1)
+#define DEVICE_TYPE_ANALOG_OUTPUT      (1 << 0)
+
+/*
+ * Bits we care about when checking for DEVICE_TYPE_eDP. Depending on the
+ * system, the other bits may or may not be set for eDP outputs.
+ */
+#define DEVICE_TYPE_eDP_BITS \
+       (DEVICE_TYPE_INTERNAL_CONNECTOR |       \
+        DEVICE_TYPE_MIPI_OUTPUT |              \
+        DEVICE_TYPE_COMPOSITE_OUTPUT |         \
+        DEVICE_TYPE_DUAL_CHANNEL |             \
+        DEVICE_TYPE_LVDS_SINGALING |           \
+        DEVICE_TYPE_TMDS_DVI_SIGNALING |       \
+        DEVICE_TYPE_VIDEO_SIGNALING |          \
+        DEVICE_TYPE_DISPLAYPORT_OUTPUT |       \
+        DEVICE_TYPE_ANALOG_OUTPUT)
+
+#define DEVICE_TYPE_DP_DUAL_MODE_BITS \
+       (DEVICE_TYPE_INTERNAL_CONNECTOR |       \
+        DEVICE_TYPE_MIPI_OUTPUT |              \
+        DEVICE_TYPE_COMPOSITE_OUTPUT |         \
+        DEVICE_TYPE_LVDS_SINGALING |           \
+        DEVICE_TYPE_TMDS_DVI_SIGNALING |       \
+        DEVICE_TYPE_VIDEO_SIGNALING |          \
+        DEVICE_TYPE_DISPLAYPORT_OUTPUT |       \
+        DEVICE_TYPE_DIGITAL_OUTPUT |           \
+        DEVICE_TYPE_ANALOG_OUTPUT)
+
 #define DEVICE_CFG_NONE                0x00
 #define DEVICE_CFG_12BIT_DVOB  0x01
 #define DEVICE_CFG_12BIT_DVOC  0x02
@@ -226,10 +280,30 @@ struct bdb_general_features {
 #define DEVICE_WIRE_DVOB_MASTER 0x0d
 #define DEVICE_WIRE_DVOC_MASTER 0x0e
 
+/* dvo_port pre BDB 155 */
 #define DEVICE_PORT_DVOA       0x00 /* none on 845+ */
 #define DEVICE_PORT_DVOB       0x01
 #define DEVICE_PORT_DVOC       0x02
 
+/* dvo_port BDB 155+ */
+#define DVO_PORT_HDMIA         0
+#define DVO_PORT_HDMIB         1
+#define DVO_PORT_HDMIC         2
+#define DVO_PORT_HDMID         3
+#define DVO_PORT_LVDS          4
+#define DVO_PORT_TV            5
+#define DVO_PORT_CRT           6
+#define DVO_PORT_DPB           7
+#define DVO_PORT_DPC           8
+#define DVO_PORT_DPD           9
+#define DVO_PORT_DPA           10
+#define DVO_PORT_DPE           11                              /* 193 */
+#define DVO_PORT_HDMIE         12                              /* 193 */
+#define DVO_PORT_MIPIA         21                              /* 171 */
+#define DVO_PORT_MIPIB         22                              /* 171 */
+#define DVO_PORT_MIPIC         23                              /* 171 */
+#define DVO_PORT_MIPID         24                              /* 171 */
+
 #define LEGACY_CHILD_DEVICE_CONFIG_SIZE                33
 
 /*
@@ -252,7 +326,7 @@ struct bdb_general_features {
  */
 struct child_device_config {
        u16 handle;
-       u16 device_type;
+       u16 device_type; /* See DEVICE_TYPE_* above */
 
        union {
                u8  device_id[10]; /* ascii string */
@@ -276,7 +350,7 @@ struct child_device_config {
        } __packed;
 
        u16 addin_offset;
-       u8 dvo_port;
+       u8 dvo_port; /* See DEVICE_PORT_* and DVO_PORT_* above */
        u8 i2c_pin;
        u8 slave_addr;
        u8 ddc_pin;
@@ -306,7 +380,11 @@ struct child_device_config {
                } __packed;
        } __packed;
 
-       u8 capabilities;
+       u8 pipe_cap:2;
+       u8 sdvo_stall:1;                                        /* 158 */
+       u8 hpd_status:2;
+       u8 integrated_encoder:1;
+       u8 capabilities_reserved:2;
        u8 dvo_wiring; /* See DEVICE_WIRE_* above */
 
        union {
@@ -316,10 +394,12 @@ struct child_device_config {
 
        u16 extended_type;
        u8 dvo_function;
-       u8 flags2;                                              /* 195 */
+       u8 dp_usb_type_c:1;                                     /* 195 */
+       u8 flags2_reserved:7;                                   /* 195 */
        u8 dp_gpio_index;                                       /* 195 */
        u16 dp_gpio_pin_num;                                    /* 195 */
-       u8 iboost_level;
+       u8 dp_iboost_level:4;                                   /* 196 */
+       u8 hdmi_iboost_level:4;                                 /* 196 */
 } __packed;
 
 struct bdb_general_definitions {
@@ -768,81 +848,6 @@ struct bdb_psr {
 #define   SWF14_APM_STANDBY    0x1
 #define   SWF14_APM_RESTORE    0x0
 
-/* Add the device class for LFP, TV, HDMI */
-#define         DEVICE_TYPE_INT_LFP    0x1022
-#define         DEVICE_TYPE_INT_TV     0x1009
-#define         DEVICE_TYPE_HDMI       0x60D2
-#define         DEVICE_TYPE_DP         0x68C6
-#define         DEVICE_TYPE_DP_DUAL_MODE       0x60D6
-#define         DEVICE_TYPE_eDP        0x78C6
-
-#define  DEVICE_TYPE_CLASS_EXTENSION   (1 << 15)
-#define  DEVICE_TYPE_POWER_MANAGEMENT  (1 << 14)
-#define  DEVICE_TYPE_HOTPLUG_SIGNALING (1 << 13)
-#define  DEVICE_TYPE_INTERNAL_CONNECTOR        (1 << 12)
-#define  DEVICE_TYPE_NOT_HDMI_OUTPUT   (1 << 11)
-#define  DEVICE_TYPE_MIPI_OUTPUT       (1 << 10)
-#define  DEVICE_TYPE_COMPOSITE_OUTPUT  (1 << 9)
-#define  DEVICE_TYPE_DUAL_CHANNEL      (1 << 8)
-#define  DEVICE_TYPE_HIGH_SPEED_LINK   (1 << 6)
-#define  DEVICE_TYPE_LVDS_SINGALING    (1 << 5)
-#define  DEVICE_TYPE_TMDS_DVI_SIGNALING        (1 << 4)
-#define  DEVICE_TYPE_VIDEO_SIGNALING   (1 << 3)
-#define  DEVICE_TYPE_DISPLAYPORT_OUTPUT        (1 << 2)
-#define  DEVICE_TYPE_DIGITAL_OUTPUT    (1 << 1)
-#define  DEVICE_TYPE_ANALOG_OUTPUT     (1 << 0)
-
-/*
- * Bits we care about when checking for DEVICE_TYPE_eDP
- * Depending on the system, the other bits may or may not
- * be set for eDP outputs.
- */
-#define DEVICE_TYPE_eDP_BITS \
-       (DEVICE_TYPE_INTERNAL_CONNECTOR | \
-        DEVICE_TYPE_MIPI_OUTPUT | \
-        DEVICE_TYPE_COMPOSITE_OUTPUT | \
-        DEVICE_TYPE_DUAL_CHANNEL | \
-        DEVICE_TYPE_LVDS_SINGALING | \
-        DEVICE_TYPE_TMDS_DVI_SIGNALING | \
-        DEVICE_TYPE_VIDEO_SIGNALING | \
-        DEVICE_TYPE_DISPLAYPORT_OUTPUT | \
-        DEVICE_TYPE_ANALOG_OUTPUT)
-
-#define DEVICE_TYPE_DP_DUAL_MODE_BITS \
-       (DEVICE_TYPE_INTERNAL_CONNECTOR | \
-        DEVICE_TYPE_MIPI_OUTPUT | \
-        DEVICE_TYPE_COMPOSITE_OUTPUT | \
-        DEVICE_TYPE_LVDS_SINGALING | \
-        DEVICE_TYPE_TMDS_DVI_SIGNALING | \
-        DEVICE_TYPE_VIDEO_SIGNALING | \
-        DEVICE_TYPE_DISPLAYPORT_OUTPUT | \
-        DEVICE_TYPE_DIGITAL_OUTPUT | \
-        DEVICE_TYPE_ANALOG_OUTPUT)
-
-/* define the DVO port for HDMI output type */
-#define                DVO_B           1
-#define                DVO_C           2
-#define                DVO_D           3
-
-/* Possible values for the "DVO Port" field for versions >= 155: */
-#define DVO_PORT_HDMIA 0
-#define DVO_PORT_HDMIB 1
-#define DVO_PORT_HDMIC 2
-#define DVO_PORT_HDMID 3
-#define DVO_PORT_LVDS  4
-#define DVO_PORT_TV    5
-#define DVO_PORT_CRT   6
-#define DVO_PORT_DPB   7
-#define DVO_PORT_DPC   8
-#define DVO_PORT_DPD   9
-#define DVO_PORT_DPA   10
-#define DVO_PORT_DPE   11
-#define DVO_PORT_HDMIE 12
-#define DVO_PORT_MIPIA 21
-#define DVO_PORT_MIPIB 22
-#define DVO_PORT_MIPIC 23
-#define DVO_PORT_MIPID 24
-
 /* Block 52 contains MIPI configuration block
  * 6 * bdb_mipi_config, followed by 6 pps data block
  * block below