Toggling Picture-by-Picture on a Samsung Odyssey Neo G9 57" switches
the sink between SST (PbP) and MST (fullscreen) on the same UHBR link. On
an RX 9070 XT (DCN 4.0.1) it hard-locked the machine every time: the
stale stream of the previous mode is torn down after the new mode's
stream is lit, and that teardown powers the sink down and turns the PHY
off under the new stream. Analysis and logs are in
https://gitlab.freedesktop.org/drm/amd/-/work_items/5671

Patch 2 fixes the teardown. Patch 1 makes the MST payload release in
amdgpu_dm safe against releasing a payload twice or one that was never
added. The tested sequences hit both, and without patch 1 payload_count
underflows.

Tested on 7.3.5 with the equivalent code in link_dpms.c, with DP AUX
debug logging: PbP off and on, and DPMS sleep/wake in both modes,
including a wake where the first UHBR13.5 training fails with channel EQ
timeouts and the link recovers after re-detection. No hangs, the payloads
always start at slot 0, and the "kept up" path only triggers when the
other mode's stream is enabled.

Changes in v2 (thanks to the Sashiko review of v1):
- Detect a stale stream by checking the current state for an enabled
  stream of the other mode on the same link, instead of comparing the
  signal with link->type. link->type is temporarily SST during
  detection, so v1 also skipped the teardown during destructive link
  verification on an MST link and released the payload twice.
- Use link_set_dsc_on_stream() for the stale stream so the sink's
  DP_DSC_ENABLE is left alone.
- Skip deallocate_usb4_bandwidth() for the stale stream.
- Clear the stale stream encoder's VC rate and hblank settings when the
  link runs 128b/132b.
- New patch 1/2.

v1: https://lore.kernel.org/amd-gfx/[email protected]/


Bart Verwilst (2):
  drm/amd/display: don't release an MST payload that holds no time slots
  drm/amd/display: don't tear down a shared link for a stale SST/MST
    stream

 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 16 ++++
 .../drm/amd/display/dc/link/link_dpms_v1.c    | 96 +++++++++++++++++--
 2 files changed, 106 insertions(+), 6 deletions(-)

-- 
2.56.1

Reply via email to