Work around needed for buggy / incorrectly implemented Display Port deep sleep.
Brief summary of the problem:
When resuming from a long dpms "session" my monitor rapidly disconnects and reconnects, causing sway to detect a new monitor, and sometimes just straight up crash or fail to initialize the monitor for sway, this always crashes 3D software that is "pinned" to the monitor, and will rearrange applications around, this is a long standing issue with Display Port Spec implementation and several panel manufacturers:
https://www.reddit.com/r/nvidia/comments/66opvp/this_displayport_hotplug_madness_finally_needs_to/
the line:
[1116306.993048] amdgpu 0000:09:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x00000012 SMN_C2PMSG_82:0x00000006
[1116306.993053] amdgpu 0000:09:00.0: amdgpu: Failed to retrieve enabled ppfeatures!
[1118008.039812] snd_hda_intel 0000:09:00.1: Refused to change power state from D0 to D3hot
in dmesg seems to be related to sway failing to turn the display back on.
Hardware description:
- CPU: Ryzen 5600X
- GPU: RX 5700
- System Memory: 32GB
- Display(s): - 'Dell Inc. DELL P2314H D59H247SAGRL' - 'Goldstar Company Ltd LG ULTRAGEAR 203NTDV9B106' (the offending monitor)
- Type of Display Connection: DP
System information:
- Distro name and Version: NixOS unstable
- Kernel version: Linux Purple-Sunrise 6.1.10 #1 (closed)-NixOS
- Custom kernel: bcachefs patches
- glxinfo:
- Device: AMD Radeon RX 5700 XT (navi10, LLVM 15.0.7, DRM 3.49, 6.1.10-bcachefs-5fc458d) (0x731f) Version: Mesa 22.3.4
Log files
- Dmesg log (full log) https://gist.github.com/YellowOnion/eab70e429afd1ba058fa1442c6b02c60#file-gistfile1-txt-L1890
]$ xrandr --listmonitors
Monitors: 2
0: +XWAYLAND1 1080/510x1920/290+2560+0 XWAYLAND1
1: +XWAYLAND4 2560/700x1440/390+0+0 XWAYLAND4
note how WAYLAND0 is now WAYLAND4 after 4 resumes.