OSDN Git Service

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)
commit594c504d33343657ad3b24ff8e4ef032cd4de25e
treea8d9de80b4ace44037bde9e50d4f87bdb985bdc9
parenteb9fcf63857556d5eacd67f5c96078e643a8d15a
drm/i915/bios: Use i915->vbt.ports[] for all g4x+

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