• Imre Deak's avatar
    drm/i915/dp: Add support for DP tunnel BW allocation · 91888b5b
    Imre Deak authored
    Add support to enable the DP tunnel BW allocation mode. Follow-up
    patches will call the required helpers added here to prepare for a
    modeset on a link with DP tunnels, the last change in the patchset
    actually enabling BWA.
    
    With BWA enabled, the driver will expose the full mode list a display
    supports, regardless of any BW limitation on a shared (Thunderbolt)
    link. Such BW limits will be checked against only during a modeset, when
    the driver has the full knowledge of each display's BW requirement.
    
    If the link BW changes in a way that a connector's modelist may also
    change, userspace will get a hotplug notification for all the connectors
    sharing the same link (so it can adjust the mode used for a display).
    
    The BW limitation can change at any point, asynchronously to modesets
    on a given connector, so a modeset can fail even though the atomic check
    for it passed. In such scenarios userspace will get a bad link
    notification and in response is supposed to retry the modeset.
    
    v2:
    - Fix old vs. new connector state in intel_dp_tunnel_atomic_check_state().
      (Ville)
    - Fix propagating the error from
      intel_dp_tunnel_atomic_compute_stream_bw(). (Ville)
    - Move tunnel==NULL checks from driver to DRM core helpers. (Ville)
    - Simplify return flow from intel_dp_tunnel_detect(). (Ville)
    - s/dp_tunnel_state/inherited_dp_tunnels (Ville)
    - Simplify struct intel_dp_tunnel_inherited_state. (Ville)
    - Unconstify object pointers (vs. states) where possible. (Ville)
    - Init crtc_state while declaring it in check_group_state(). (Ville)
    - Join obj->base.id, obj->name arg lines in debug prints to reduce LOC.
      (Ville)
    - Add/rework intel_dp_tunnel_atomic_alloc_bw() to prepare for moving the
      BW allocation from encoder hooks up to intel_atomic_commit_tail()
      later in the patchset.
    - Disable BW alloc mode during system suspend.
    - Allocate the required BW for all tunnels during system resume.
    - Add intel_dp_tunnel_atomic_clear_stream_bw() instead of the open-coded
      sequence in a follow-up patch.
    - Add function documentation to all exported functions.
    - Add CONFIG_USB4 dependency to CONFIG_DRM_I915_DP_TUNNEL.
    
    v3:
    - Rebase on intel_dp_get_active_pipes() change in previous patch.
    
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
    Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240226185246.1276018-4-imre.deak@intel.com
    91888b5b
Kconfig 5.61 KB