1. 26 Jan, 2022 10 commits
  2. 25 Jan, 2022 1 commit
  3. 24 Jan, 2022 13 commits
  4. 21 Jan, 2022 8 commits
  5. 20 Jan, 2022 2 commits
  6. 19 Jan, 2022 6 commits
    • Ville Syrjälä's avatar
      drm/i915/hdmi: Ignore DP++ TMDS clock limit for native HDMI ports · c2696280
      Ville Syrjälä authored
      Lots of machines these days seem to have a crappy type1 DP dual
      mode adaptor chip slapped onto the motherboard. Based on the
      DP dual mode spec we currently limit those to 165MHz max TMDS
      clock.
      
      Windows OTOH ignores DP dual mode adaptors when the VBT
      indicates that the port is not actually DP++, so we can
      perhaps assume that the vendors did intend that the 165MHz
      clock limit doesn't apply here. Though it would be much
      nicer if they actually declared an explicit limit through
      VBT, but that doesn't seem to be happening either.
      
      So in order to match Windows behaviour let's ignore the
      DP dual mode adaptor's TMDS clock limit for ports that
      don't look like DP++ in VBT.
      
      Unfortunately many older VBTs misdelcare their DP++ ports
      as just HDMI (eg. ILK Dell Latitude E5410) or DP (eg. SNB
      Lenovo ThinkPad X220). So we can't really do this universally
      without risking black screens. I suppose a sensible cutoff
      is HSW+ since that's when 4k became a thing and one might
      assume that the machines have been tested to work with higher
      TMDS clock rates.
      
      v2: s/IS_BROADWELL/IS_HASWELL/
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211222161738.12478-1-ville.syrjala@linux.intel.com
      c2696280
    • Ville Syrjälä's avatar
      drm/i915/bios: Nuke DEVICE_TYPE_DP_DUAL_MODE_BITS · 044cbc7a
      Ville Syrjälä authored
      Replace the DEVICE_TYPE_DP_DUAL_MODE_BITS stuff with just
      a DP+HDMI check. The rest of the bits shouldn't really
      matter anyway.
      
      The slight change in behaviour here is that now we do look at
      the DEVICE_TYPE_NOT_HDMI_OUTPUT bit (via
      intel_bios_encoder_supports_hdmi()) when we previously ignored it.
      The one platform we know that has problems with that bit is VLV.
      But IIRC the problem was always that buggy VBTs basically never
      set that bit. So that should be OK since all it would do is make
      all DVI ports look like HDMI ports instead. Also can't imagine
      there are many VLV machines with actual DVI ports in existence.
      
      We still keep the rest of the dvo_port/aux_ch checks as we
      can't trust that DP+HDMI device type equals DP++ due to
      buggy VBTs.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211217155403.31477-6-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      044cbc7a
    • Ville Syrjälä's avatar
      drm/i915/bios: Throw out the !has_ddi_port_info() codepaths · a868a1e5
      Ville Syrjälä authored
      Now that we parse the DDI port info from the VBT on all g4x+ platforms
      we can throw out all the old codepaths in intel_bios_is_port_present(),
      intel_bios_is_port_edp() and intel_bios_is_port_dp_dual_mode(). None
      of these should be called on pre-g4x platforms.
      
      For good measure throw in a WARN into intel_bios_is_port_present()
      should someone get the urge to call it on older platforms. The
      other two functions are specific to HDMI and DP so should not need
      any protection as those encoder types don't even exist on older
      platforms.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211217155403.31477-5-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      a868a1e5
    • Ville Syrjälä's avatar
      drm/i915/bios: Use i915->vbt.ports[] for all g4x+ · 594c504d
      Ville Syrjälä authored
      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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211217155403.31477-4-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      594c504d
    • Ville Syrjälä's avatar
      drm/i915/bios: Use i915->vbt.ports[] on CHV · eb9fcf63
      Ville Syrjälä authored
      CHV is currently straddling the divide by using parse_ddi_ports() stuff
      for aux_ch/ddc_pin but going through all old codepaths for the rest
      (intel_bios_is_port_present(), intel_bios_is_port_edp(),
      intel_bios_is_port_dp_dual_mode()). Let's switch over full and use
      i915->vbt.ports[] for the rest of the stuff.
      
      dvo_port_to_port() doesn't know about DSI so we won't get into
      any kind of "is port B HDMI or DSI or both?" conundrum, which
      could otherwise happen on VLV/CHV due to DSI ports living in a
      separate world from the other digital ports.
      
      Including Jani's detailed analysis here for posterity:
      "We stop checking for port A for CHV in intel_bios_is_port_present(), but
       it's a warn and I don't recall any bug reports, so probably fine. We
       could add a check in parse_ddi_port(), but meh.
      
       Ditto for intel_bios_is_port_dp_dual_mode(), except it doesn't have a
       warn.
      
       The eDP check in intel_bios_is_port_edp() becomes slightly more
       relaxed. Both the old and new check require these to be set:
      
       - DEVICE_TYPE_DISPLAYPORT_OUTPUT
       - DEVICE_TYPE_INTERNAL_CONNECTOR.
      
       The old code also required these to be unset:
      
       - DEVICE_TYPE_MIPI_OUTPUT
       - DEVICE_TYPE_COMPOSITE_OUTPUT
       - DEVICE_TYPE_DUAL_CHANNEL
       - DEVICE_TYPE_LVDS_SIGNALING
       - DEVICE_TYPE_TMDS_DVI_SIGNALING
       - DEVICE_TYPE_VIDEO_SIGNALING
       - DEVICE_TYPE_ANALOG_OUTPUT
      
       It's possible we've added these just as a sanity check for broken VBTs
       more than anything. I guess I'd see if actual problems arise.
      
       Bottom line, I think the functional changes matter only for VBTs with
       bogus data."
      
      I agree that it should work assuming the VBT isn't totally insane.
      Modern windows drivers also don't seem to check any of those
      additional device type bits, which may or may not matter for older
      devices (no idea what some old driver versions are checking).
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211217155403.31477-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      eb9fcf63
    • Ville Syrjälä's avatar
      b90b6e41