drm/i915/bios: Use i915->vbt.ports[] for all g4x+
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 17 Dec 2021 15:54:00 +0000 (17:54 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 19 Jan 2022 22:06:51 +0000 (00:06 +0200)
Extend the vbt.ports[] stuff for all g4x+ platforms. We do need
to drop the version check as some elk/ctg machines may have VBTs
older than that. The oldest I know is an elk with version 142.
But the child device stuff has had the correct size since at
least version 125 (observed on my sdg), so from that angle this
should be totally safe.

This does couple of things:
- Start using the aux_ch/ddc_pin from VBT instead of just the
  hardcoded defaults. Hopefully there are no VBTs with entirely
  bogus information here.
- Start using i915->vbt.ports[] for intel_bios_is_port_dp_dual_mode().
  Should be fine as the logic doesn't actually change.
- Start using i915->vbt.ports[] for intel_bios_is_port_edp().
  The old codepath only looks at the DP DVO ports, the new codepath
  looks at both DP and HDMI DVO ports. In principle that should not
  matter. We also stop looking at some of the other device type bits
  (eg. LVDS,MIPI,ANALOG,etc.). Hopefully no VBT is broken enough that
  it sets up totally conflicting device type bits (eg. LVDS+eDP at the
  same time). We also lose the "g4x->no eDP ever" hardcoding (shouldn't
  be hard to re-introduce that into eg. sanitize_device_type() if needed).

Lightly smoke tested on a set of machines (one of ctg,ilk,snb,ivb each)
with both DP and HDMI (DP++). Everything still worked as it should.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211217155403.31477-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_bios.c

index 3c4165d19edd69799cf42b1ffcec6985c180b87b..5e562ae14df940244cf3ac98be33fdb032a39e3e 100644 (file)
@@ -2055,7 +2055,7 @@ static void parse_ddi_port(struct drm_i915_private *i915,
 
 static bool has_ddi_port_info(struct drm_i915_private *i915)
 {
-       return HAS_DDI(i915) || IS_CHERRYVIEW(i915);
+       return DISPLAY_VER(i915) >= 5 || IS_G4X(i915);
 }
 
 static void parse_ddi_ports(struct drm_i915_private *i915)
@@ -2065,9 +2065,6 @@ static void parse_ddi_ports(struct drm_i915_private *i915)
        if (!has_ddi_port_info(i915))
                return;
 
-       if (i915->vbt.version < 155)
-               return;
-
        list_for_each_entry(devdata, &i915->vbt.display_devices, node)
                parse_ddi_port(i915, devdata);
 }