Bug 455814 - Display will not wake from DPMS since 5.25 (Wayland Nvidia)
Summary: Display will not wake from DPMS since 5.25 (Wayland Nvidia)
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Unclassified
Component: wayland-generic (show other bugs)
Version: 5.25.1
Platform: Archlinux Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-06-22 21:57 UTC by tsweet64
Modified: 2022-07-16 03:42 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25.3


Attachments
output of journalctl --boot 0 | grep kwin_wayland_drm (3.45 MB, text/x-log)
2022-06-29 04:22 UTC, Andrej Halveland
Details
dmesg output with drm debugging (1.85 MB, application/zstd)
2022-06-29 19:32 UTC, Andrej Halveland
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tsweet64 2022-06-22 21:57:01 UTC
SUMMARY
Since upgrading to 5.25 (and still persisting in 5.25.1), it is impossible to wake the displays from Screen Energy Saving. While the system and session continue running fine, absolutely nothing happens when attempting to wake the display, and no relevant output at all appears in `journalctl` (if I SSH into the system to check it). I have tried disabling the new systemd startup mode for plasma, but it made no difference. How else could I best collect more information about this problem?

I reported this in `powerdevil` since it's related to the energy saving settings, but perhaps another component is at fault for the issue.

STEPS TO REPRODUCE
1. Launch a plasma wayland session (in this case, with an NVIDIA RTX 3060 connected to two displays (one HDMI and one DP)
2. Enable Screen Energy Saving in power management settings
3. Allow the displays to be put to sleep
4. Attempt to wake.

OBSERVED RESULT
Displays remain in sleep mode despite all attempts of pressing keys, moving the mouse, etc. Displays will not activate even if unplugged and plugged back in. Attempting to switch tty has no effect. Only shutting down via ssh will briefly wake them for the tty console during shutdown.

EXPECTED RESULT
Moving the mouse or touching a key will wake the display, just as it did prior to 5.25.

SOFTWARE/OS VERSIONS
 
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 1 Nate Graham 2022-06-23 14:00:01 UTC

*** This bug has been marked as a duplicate of bug 455795 ***
Comment 2 Andrej Halveland 2022-06-24 08:25:32 UTC
I have tried using the master version and the 5.25 branch and I still experience this issue. 
I still get this when viewing the journalctl with "journalctl -b | grep kwin"
"kwin_wayland_drm: Couldn't parse EDID for connector DrmConnector(id=78, gpu=KWin::DrmGpu(0x55e8f0bbe0e0), name="eDP-1-unknown", connection="Connected", countMode=14)"

Although the "kwin_wayland_drm: Setting dpms mode failed!" doesn't appear anymore with the latest commits.

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: AMD Ryzen 9 4900HS 8-Core Processor
Memory:  16GB of RAM
Graphics Processor: Integrated: Vega 8     Dedicated: NVIDIA GeForce RTX 2060 Max-Q
Manufacturer: ASUS
Comment 3 Nate Graham 2022-06-24 12:17:48 UTC
Bug 455795 was just fixed yesterday; are you sure you have https://invent.kde.org/plasma/kwin/-/commit/ea8b0d962be15fbf5c4c29ac4dd657ff34344e17?
Comment 4 Andrej Halveland 2022-06-24 13:04:36 UTC
(In reply to Nate Graham from comment #3)
> Bug 455795 was just fixed yesterday; are you sure you have
> https://invent.kde.org/plasma/kwin/-/commit/
> ea8b0d962be15fbf5c4c29ac4dd657ff34344e17?

Yes, I can assure you that I had that commit when compiling kwin.
I have used the Plasma/5.25 branch and I have checked that those changes were actually there.
The steps I have made:
1. (in kwin git folder) mkdir build && cd build
2. cmake ..
3. make -j8
4. sudo pacman -R kwin (to uninstall my current kwin package)
5. sudo make install (to install newly compiled kwin)
6. restarted my machine
Comment 5 Andrej Halveland 2022-06-28 17:56:05 UTC
I have updated to Plasma 5.25.2 but the issue still persists. But as I previously said, this error doesn't appear anymore.
>kwin_wayland_drm: Setting dpms mode failed! 

But this one still does:
>kwin_wayland_drm: Couldn't parse EDID for connector DrmConnector(id=78, gpu=KWin::DrmGpu(0x55d5c9178250), name="eDP-1-unknown", connection="Connected"```, countMode=14)

For now I use a really hacky workaround where I basically enable the dpms back on with "kscreen-doctor --dpms on" by using systemd to execute it before suspending. After that resuming works perfectly.
And btw how can I make sure that Xaver Hugl has been CC'd or "pinged" again? I am not sure how all of this works exactly. Thanks!
Comment 6 Zamundaaa 2022-06-28 21:28:44 UTC
The EDID problem is known but shouldn't cause any real problems.

To help debug this, please add
> QT_LOGGING_RULES="kwin_*.debug=true"
to /etc/environment, reboot, reproduce the problem and upload the output of
> journalctl --boot 0 | grep kwin_wayland_drm
(or --boot -1" if you have to reboot afterwards)
Comment 7 Andrej Halveland 2022-06-29 04:22:29 UTC
Created attachment 150244 [details]
output of journalctl --boot 0 | grep kwin_wayland_drm

Yeah, I think the
>Atomic test for (0) failed! Invalid argument
is the main culprit here, I hope...
Comment 8 Zamundaaa 2022-06-29 19:02:57 UTC
Not sure what's going on there - it's failing to disable the output, not enable it...

Can you execute
> echo 0x1FF | sudo tee /sys/module/drm/parameters/debug
to enable debug logging, and then
> sudo dmesg -w > dmesg.log
(leave that running), reproduce the problem and upload the generated file?
Comment 9 Andrej Halveland 2022-06-29 19:32:08 UTC
Created attachment 150274 [details]
dmesg output with drm debugging

> So I started the logging > turned off dpms > closed the lid to put the system to sleep > resumed from suspend by opening the lid > SSH'd to my laptop from another computer > killed kwin with "sudo pkill -9 kwin"
Comment 10 Bug Janitor Service 2022-06-30 23:04:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2599
Comment 11 Zamundaaa 2022-06-30 23:05:39 UTC
I think I see what is going on. After suspend, the driver appears to enable the display again behind KWin's back and KWin doesn't handle that situation correctly.
Can you test the merge request and check if that fixes the problem?
Comment 12 Andrej Halveland 2022-07-01 11:09:46 UTC
The merge request @ https://invent.kde.org/plasma/kwin/-/merge_requests/2599 did indeed fix the issue for me.
Comment 13 Zamundaaa 2022-07-01 14:37:27 UTC
Can you check if https://invent.kde.org/plasma/kwin/-/merge_requests/2602 works as well? That would be abit less risky to backport

Btw, the bug report will be closed automatically once a commit is merged that fixes it, there's no need to change the status yourself
Comment 14 Andrej Halveland 2022-07-01 16:40:26 UTC
Oh, ok.

Anyways, https://invent.kde.org/plasma/kwin/-/merge_requests/2602 does not work/improve anything, screen stays black and keyboard is unresponsive like on the "stock" build
Comment 15 Zamundaaa 2022-07-01 17:21:22 UTC
Sorry, there was one bug left in it. Can you re-test?
Comment 16 Andrej Halveland 2022-07-01 18:28:44 UTC
Sadly, it's the same
Comment 17 Zamundaaa 2022-07-02 16:25:23 UTC
Can you do one more test? If this doesn't work then maybe I misjudged where the bug came from
Comment 18 Andrej Halveland 2022-07-02 17:05:49 UTC
This time it works!
Comment 19 Zamundaaa 2022-07-11 17:45:04 UTC
Git commit 0d302d5c66924ea061db5cf8059887911f7c8831 by Xaver Hugl.
Committed on 11/07/2022 at 14:31.
Pushed by zamundaaa into branch 'master'.

backends/drm: also check for properties in DrmPipeline::needsModeset

Otherwise we may be missing situations where a modeset is needed

M  +14   -0    src/backends/drm/drm_pipeline.cpp

https://invent.kde.org/plasma/kwin/commit/0d302d5c66924ea061db5cf8059887911f7c8831
Comment 20 Zamundaaa 2022-07-11 18:17:41 UTC
Git commit d0634166267c6ee02b4a4caeaa945e07302e222f by Xaver Hugl.
Committed on 11/07/2022 at 18:17.
Pushed by zamundaaa into branch 'Plasma/5.25'.

backends/drm: also check for properties in DrmPipeline::needsModeset

Otherwise we may be missing situations where a modeset is needed


(cherry picked from commit 0d302d5c66924ea061db5cf8059887911f7c8831)

M  +14   -0    src/backends/drm/drm_pipeline.cpp

https://invent.kde.org/plasma/kwin/commit/d0634166267c6ee02b4a4caeaa945e07302e222f