aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_bios.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c89
1 files changed, 83 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 1faa494e2bc9..0694aa8bb9bc 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -420,6 +420,13 @@ parse_general_features(struct drm_i915_private *dev_priv,
420 intel_bios_ssc_frequency(dev_priv, general->ssc_freq); 420 intel_bios_ssc_frequency(dev_priv, general->ssc_freq);
421 dev_priv->vbt.display_clock_mode = general->display_clock_mode; 421 dev_priv->vbt.display_clock_mode = general->display_clock_mode;
422 dev_priv->vbt.fdi_rx_polarity_inverted = general->fdi_rx_polarity_inverted; 422 dev_priv->vbt.fdi_rx_polarity_inverted = general->fdi_rx_polarity_inverted;
423 if (bdb->version >= 181) {
424 dev_priv->vbt.orientation = general->rotate_180 ?
425 DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP :
426 DRM_MODE_PANEL_ORIENTATION_NORMAL;
427 } else {
428 dev_priv->vbt.orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
429 }
423 DRM_DEBUG_KMS("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d fdi_rx_polarity_inverted %d\n", 430 DRM_DEBUG_KMS("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d fdi_rx_polarity_inverted %d\n",
424 dev_priv->vbt.int_tv_support, 431 dev_priv->vbt.int_tv_support,
425 dev_priv->vbt.int_crt_support, 432 dev_priv->vbt.int_crt_support,
@@ -852,6 +859,30 @@ parse_mipi_config(struct drm_i915_private *dev_priv,
852 859
853 parse_dsi_backlight_ports(dev_priv, bdb->version, port); 860 parse_dsi_backlight_ports(dev_priv, bdb->version, port);
854 861
862 /* FIXME is the 90 vs. 270 correct? */
863 switch (config->rotation) {
864 case ENABLE_ROTATION_0:
865 /*
866 * Most (all?) VBTs claim 0 degrees despite having
867 * an upside down panel, thus we do not trust this.
868 */
869 dev_priv->vbt.dsi.orientation =
870 DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
871 break;
872 case ENABLE_ROTATION_90:
873 dev_priv->vbt.dsi.orientation =
874 DRM_MODE_PANEL_ORIENTATION_RIGHT_UP;
875 break;
876 case ENABLE_ROTATION_180:
877 dev_priv->vbt.dsi.orientation =
878 DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
879 break;
880 case ENABLE_ROTATION_270:
881 dev_priv->vbt.dsi.orientation =
882 DRM_MODE_PANEL_ORIENTATION_LEFT_UP;
883 break;
884 }
885
855 /* We have mandatory mipi config blocks. Initialize as generic panel */ 886 /* We have mandatory mipi config blocks. Initialize as generic panel */
856 dev_priv->vbt.dsi.panel_id = MIPI_DSI_GENERIC_PANEL_ID; 887 dev_priv->vbt.dsi.panel_id = MIPI_DSI_GENERIC_PANEL_ID;
857} 888}
@@ -2039,17 +2070,17 @@ bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,
2039 2070
2040 dvo_port = child->dvo_port; 2071 dvo_port = child->dvo_port;
2041 2072
2042 switch (dvo_port) { 2073 if (dvo_port == DVO_PORT_MIPIA ||
2043 case DVO_PORT_MIPIA: 2074 (dvo_port == DVO_PORT_MIPIB && IS_ICELAKE(dev_priv)) ||
2044 case DVO_PORT_MIPIC: 2075 (dvo_port == DVO_PORT_MIPIC && !IS_ICELAKE(dev_priv))) {
2045 if (port) 2076 if (port)
2046 *port = dvo_port - DVO_PORT_MIPIA; 2077 *port = dvo_port - DVO_PORT_MIPIA;
2047 return true; 2078 return true;
2048 case DVO_PORT_MIPIB: 2079 } else if (dvo_port == DVO_PORT_MIPIB ||
2049 case DVO_PORT_MIPID: 2080 dvo_port == DVO_PORT_MIPIC ||
2081 dvo_port == DVO_PORT_MIPID) {
2050 DRM_DEBUG_KMS("VBT has unsupported DSI port %c\n", 2082 DRM_DEBUG_KMS("VBT has unsupported DSI port %c\n",
2051 port_name(dvo_port - DVO_PORT_MIPIA)); 2083 port_name(dvo_port - DVO_PORT_MIPIA));
2052 break;
2053 } 2084 }
2054 } 2085 }
2055 2086
@@ -2159,3 +2190,49 @@ intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
2159 2190
2160 return false; 2191 return false;
2161} 2192}
2193
2194enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *dev_priv,
2195 enum port port)
2196{
2197 const struct ddi_vbt_port_info *info =
2198 &dev_priv->vbt.ddi_port_info[port];
2199 enum aux_ch aux_ch;
2200
2201 if (!info->alternate_aux_channel) {
2202 aux_ch = (enum aux_ch)port;
2203
2204 DRM_DEBUG_KMS("using AUX %c for port %c (platform default)\n",
2205 aux_ch_name(aux_ch), port_name(port));
2206 return aux_ch;
2207 }
2208
2209 switch (info->alternate_aux_channel) {
2210 case DP_AUX_A:
2211 aux_ch = AUX_CH_A;
2212 break;
2213 case DP_AUX_B:
2214 aux_ch = AUX_CH_B;
2215 break;
2216 case DP_AUX_C:
2217 aux_ch = AUX_CH_C;
2218 break;
2219 case DP_AUX_D:
2220 aux_ch = AUX_CH_D;
2221 break;
2222 case DP_AUX_E:
2223 aux_ch = AUX_CH_E;
2224 break;
2225 case DP_AUX_F:
2226 aux_ch = AUX_CH_F;
2227 break;
2228 default:
2229 MISSING_CASE(info->alternate_aux_channel);
2230 aux_ch = AUX_CH_A;
2231 break;
2232 }
2233
2234 DRM_DEBUG_KMS("using AUX %c for port %c (VBT)\n",
2235 aux_ch_name(aux_ch), port_name(port));
2236
2237 return aux_ch;
2238}