1. 02 Jan, 2019 6 commits
  2. 31 Dec, 2018 13 commits
  3. 28 Dec, 2018 7 commits
  4. 27 Dec, 2018 2 commits
  5. 25 Dec, 2018 3 commits
  6. 22 Dec, 2018 1 commit
  7. 21 Dec, 2018 4 commits
  8. 20 Dec, 2018 1 commit
  9. 18 Dec, 2018 3 commits
    • Imre Deak's avatar
      drm/i915/icl: Add fallback detection method for TypeC legacy ports · 2a041c97
      Imre Deak authored
      Add a fallback detection method for TypeC legacy ports in case the
      VBT port information used to detect normally such ports is
      incorrect.
      
      For the fallback method we use the TypeC legacy mode specific HPD
      interrupt flag which should only be raised for a legacy port.
      
      WARN if the VBT port info is incorrect.
      
      In a case where we'd detect the port in a contradicting way both as a
      legacy and also as a USB DP and/or TBT alternate port treat the port
      as legacy (by also emitting a WARN from icl_update_tc_port_type).
      
      v2:
      - Repurpose the detection as a fallback method instead of using
        it only for the DP legacy case. By now we should normally use VBT to
        detect DP legacy ports as well.
      Suggested-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: José Roberto de Souza <jose.souza@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (v1)
      Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181214182703.18865-5-imre.deak@intel.com
      2a041c97
    • Imre Deak's avatar
      drm/i915/icl: Fix HPD handling for TypeC legacy ports · f6bff60e
      Imre Deak authored
      Atm HPD disconnect events on TypeC ports will break things, since we'll
      switch the TypeC mode (between legacy and disconnected modes as well as
      among USB DP alternate, Thunderbolt alternate and disconnected modes) on
      the fly from the HPD disconnect interrupt work while the port may be
      still active.
      
      Even if the port happens to be not active during the disconnect we'd
      still have a problem during a subsequent modeset or AUX transfer that
      could happen regardless of the port's connected state. For instance the
      system resume display mode restore code and userspace could perform a
      modeset on the port or userspace could start an AUX transfer even if the
      port is in disconnected state.
      
      To fix this keep TypeC legacy ports in legacy mode whenever we're not
      suspended. This mode is a static configuration as opposed to the
      Thunderbolt and USB DP alternate modes between which we can switch
      dynamically.
      
      We determine if a TypeC port is legacy (wired to a legacy HDMI or a
      legacy DP connector) via the VBT DDI port specific USB-TypeC and
      Thunderbolt flags. If both these flags are cleared then the port is
      configured for legacy mode.
      
      On such legacy ports we'll run the TypeC PHY connect sequence explicitly
      during driver loading and system resume (vs. running the sequence during
      HPD processing). The connect will succeed even if the display is not
      connected to begin with (or disappears during the suspended state) since
      for legacy ports the PORT_TX_DFLEXDPPMS / DP_PHY_MODE_STATUS_COMPLETED
      flag is always set (as opposed to the USB DP alternate mode where it
      gets set only when a display is connected).
      
      Correspondingly run the TypeC PHY disconnect sequence during system
      suspend and driver unloading. For the unloading case I had to split
      up intel_dp_encoder_destroy() to be able to have the 1. flush any
      pending encoder work, 2. disconnect TC PHY, 3. call DRM core cleanup and
      kfree on the encoder object.
      
      For now run the PHY disconnect during suspend only for TypeC legacy
      ports. We will need to disconnect even in USB DP alternate mode in the
      future, but atm we don't have a way to reconnect the port in this mode
      during resume if the display disappears while being suspended. So for
      now punt on this case.
      
      Note that we do not disconnect the port during runtime suspend; in
      legacy mode there are no shared HW resources (PHY lanes) with other HW
      blocks (USB), so no need to release / reacquire these resources as with
      USB DP alternate mode. The only reason to disconnect legacy ports during
      system suspend is that the PORT_TX_DFLEXDPPMS /
      DP_PHY_MODE_STATUS_COMPLETED flag must be rechecked and the port must be
      connected again during system resume. We'll also have to turn the check
      for this flag into a poll, after figuring out what's the proper timeout
      value for it.
      
      v2:
      - Remove the redundant special casing of legacy mode when doing a
        disconnect in icl_tc_port_connected(). It's guaranteed already that we
        won't disconnect legacy ports in that function.
      - Add a note about the new intel_ddi_encoder_destroy() hook.
      - Reword the commit message after switching to the VBT based detection.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108070
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108924
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: José Roberto de Souza <jose.souza@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181214182703.18865-4-imre.deak@intel.com
      f6bff60e
    • Imre Deak's avatar
      drm/i915/bios: Parse the VBT TypeC and Thunderbolt port flags · 38b3416f
      Imre Deak authored
      This is needed by the next patch to determine if a DDI TypeC port is
      physically wired to a legacy DP or legacy HDMI connector or if the port
      is wired to a USB-C/Thunderbolt connector.
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: José Roberto de Souza <jose.souza@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181214182703.18865-3-imre.deak@intel.com
      38b3416f