Bug 513040

Summary: black screen in kwin wayland after disconnecting usb-c monitor
Product: [Plasma] kwin Reporter: Nojus Gudinavičius <nojus.gudinavicius>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdedev, z.hanham00
Priority: NOR    
Version First Reported In: 6.5.3   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 506893    
Attachments: journalctl log
drm debug log

Description Nojus Gudinavičius 2025-12-07 09:19:55 UTC
Created attachment 187408 [details]
journalctl log

SUMMARY
My main setup contains of a laptop running KDE wayland, connected to a monitor via USB-C. The laptop display is configured to be off then the external monitor is connected. _Sometimes_ after I a) open the laptop lid b) disconnect the external monitor the laptop display never comes back and remains black. I can "fix" this by  ssh'ing and running `kwin --replace` from other device, but this kills the session and brightness keys no longer work for laptop screen. Rebooting obviously fixes this.

STEPS TO REPRODUCE
1. Have a running KDE wayland session with laptop (screen of) and external monitor via USB-C
2. Disconnect the external monitor and hope it reproduces

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 42
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.9.3
Kernel Version: 6.17.8-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 32 GiB of RAM (31.1 GiB usable)
Graphics Processor: Intel® Iris® Xe Graphics

ADDITIONAL INFORMATION
attaching a journalctl log of the event. The relevant lines are probably
Dec 07 10:49:19 fw kwin_wayland[1600]: kwin_wayland_drm: Atomic modeset test failed! Invalid argument
Dec 07 10:49:19 fw kwin_wayland[1600]: kwin_wayland_drm: Setting dpms mode failed!
Comment 1 TraceyC 2026-01-21 22:02:52 UTC
These logs seem relevant

Dec 07 10:49:19 fw kwin_wayland[1600]: kwin_wayland_drm: Atomic modeset test failed! Invalid argument
Dec 07 10:49:19 fw kwin_wayland[1600]: kwin_wayland_drm: Setting dpms mode failed!

Can I ask you to follow the instructions here to get us some detailed logs? This will help us investigate what's causing the failed modesets.

https://invent.kde.org/plasma/kwin/-/wikis/Debugging/Debugging-DRM-issues

Thanks!
Comment 2 Nojus Gudinavičius 2026-01-23 22:41:34 UTC
Created attachment 188834 [details]
drm debug log

managed to reproduce again, attaching the drm debug log (gzipped because it exceeds the file size limit)
Comment 3 TraceyC 2026-01-28 17:52:30 UTC
Thanks!