Skip to content
  • Lyude Paul's avatar
    drm/display/dp_mst: Add helpers for serializing SST <-> MST transitions · 5a8eb8cb
    Lyude Paul authored
    
    
    There's another kind of situation where we could potentially race with
    nonblocking modesets and MST, especially if we were to only use the locking
    provided by atomic modesetting:
    
    * Display 1 begins as enabled on DP-1 in SST mode
    * Display 1 switches to MST mode, exposes one sink in MST mode
    * Userspace does non-blocking modeset to disable the SST display
    * Userspace does non-blocking modeset to enable the MST display with a
      different CRTC, but the SST display hasn't been fully taken down yet
    * Execution order between the last two commits isn't guaranteed since they
      share no drm resources
    
    We can fix this however, by ensuring that we always pull in the atomic
    topology state whenever a connector capable of driving an MST display
    performs its atomic check - and then tracking CRTC commits happening on the
    SST connector in the MST topology state. So, let's add some simple helpers
    for doing that and hook them up in various drivers.
    
    v2:
    * Use intel_dp_mst_source_support() to check for MST support in i915, fixes
      CI failures
    
    Signed-off-by: Lyude Paul's avatarLyude Paul <lyude@redhat.com>
    Cc: Wayne Lin <Wayne.Lin@amd.com>
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: Fangzhi Zuo <Jerry.Zuo@amd.com>
    Cc: Jani Nikula <jani.nikula@intel.com>
    Cc: Imre Deak <imre.deak@intel.com>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: Sean Paul <sean@poorly.run>
    Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-14-lyude@redhat.com
    (cherry picked from commit a76eb429)
    5a8eb8cb