Bug 455795

Summary: Turning off the screen/dpms before suspending causes the screen to stay black after resuming.
Product: [Plasma] kwin Reporter: Andrej Halveland <andrej.halv>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: hugh.kernohan, nate, tsweet64, xaver.hugl
Priority: NOR Keywords: regression
Version: 5.25.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.25.2
Sentry Crash Report:
Attachments: output of journalctl -b

Description Andrej Halveland 2022-06-22 16:15:28 UTC
Created attachment 150058 [details]
output of journalctl -b

On my laptop (Asus Zephyrus G15 GA502IV (2020 Model)) if I turn off the screen to save power by using the "turn off screen" shortcut (that's located in Power Management shortcuts) and I suspend my laptop by closing the lid and then wake it up the screen is black and I can only switch to different tty and kill the kwin process to be able to log in again.
When I check the journalctl, errors such as these appear:

"kwin_wayland[942]: kwin_wayland_drm: Couldn't parse EDID for connector DrmConnector(id=78, gpu=KWin::DrmGpu(0x55afeb53ff10), name="eDP-1-unknown", connection="Connected", countMode=14)"

"kwin_wayland[942]: kwin_wayland_drm: Setting dpms mode failed!"

I am using Arch with the latest packages and I am using wayland.
I can't get kwin to crash.


STEPS TO REPRODUCE
1. Turn off screen
2. Suspend while the screen stays off
3. Resume from suspend

OBSERVED RESULT
Screen stays black

EXPECTED RESULT
Login screen should appear.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.25.1
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
If I suspend my system without turning off the screen first it behaves as it should.
Comment 1 Nate Graham 2022-06-23 14:00:01 UTC
*** Bug 455814 has been marked as a duplicate of this bug. ***
Comment 2 Hugh Kernohan 2022-06-23 17:39:38 UTC
My desktop exhibits the same behaviour as bug 445814.
After using suspend-to-RAM, the computer awakes but the two screens remains blank and no keys produce any response.
If I access remotely via SSH I can see that kwin_wayland is running variously between 93.5% and 100% CPU.  Calling  kwin_wayland --replace from the remote has no effect but using kill -KILL xxxx does.  A new instance of kwin_wayland then starts automatically, the screens return to their normal display and the keyboard is live again.
Nothing unusual or obvious is recorded in in the journalctl.
I'm using the nvidia-suspend and nvidia-resume mechanism to avoid graphics corruption.

Operating System: Arch Linux
KDE Plasma Version: 5.25.1
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 6 × Intel® Core™ i5-8600 CPU @ 3.10GHz
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
NVIDIA driver 515.48.07
Comment 3 tsweet64 2022-06-23 21:54:04 UTC
In addition to what others have reported, I also experience the problem even without using suspend-to-RAM. Simply leaving the desktop idle (with no auto-S2R) and allowing only the displays to fall asleep also results in this unrecoverable state. I also use nvidia-suspend and nvidia-resume. I will need to test killing kwin.

Including my system specs here as well (I'm the reporter of bug 455814):

Operating System: Arch Linux
KDE Plasma Version: 5.25.1
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.5-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060/PCIe/SSE2
Manufacturer: ASUS
Comment 4 Zamundaaa 2022-06-24 00:40:34 UTC
dpms + suspend should already be fixed with https://invent.kde.org/plasma/kwin/-/commit/ea8b0d962be15fbf5c4c29ac4dd657ff34344e17

(In reply to tsweet64 from comment #3)
> In addition to what others have reported, I also experience the problem even
> without using suspend-to-RAM. Simply leaving the desktop idle (with no
> auto-S2R) and allowing only the displays to fall asleep also results in this
> unrecoverable state. I also use nvidia-suspend and nvidia-resume. I will
> need to test killing kwin.

Although your problem is a bit different, the same bug can be triggered with how some monitors and GPUs behave. If it's not fixed with the above commit, please reopen bug 455814 and CC me there