Bug 505607

Summary: Screen content mangled around after sleep [radeon]
Product: [Plasma] kwin Reporter: Tech-Tac <im.tech.tac>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, xaver.hugl
Priority: NOR    
Version First Reported In: 6.3.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.5.3
Sentry Crash Report:
Attachments: Distorted desktop after blindly logging in

Description Tech-Tac 2025-06-14 20:43:31 UTC
SUMMARY
Sometimes (not clear when exactly), after waking the device up after RAM sleep and/or disk hibernation, the whole screen except for the mouse cursor appears mangled around in a sort of blocky horizontal stripy pattern.

This behavior has been observed on Wayland a desktop and a laptop running AMD Radeon HD 7560D and AMD Radeon R6/R7 respectively, with the former being on Arch and the latter on Fedora (and previously Kubuntu).

A workaround I found was to switch to another TTY and back again, seems to reset something.

STEPS TO REPRODUCE
1. Go into sleep mode
2. Wait some time (just in case, not sure about this step)
3. Wake up device

OBSERVED RESULT
There is a big chance the lock screen and subsequently the desktop all render distorted, with the mouse cursor rendering fine on top.

EXPECTED RESULT
Screen renders correctly

SOFTWARE/OS VERSIONS
Linux: Arch, Kubuntu 25.04, Fedora 42
KDE Plasma Version: 6.3.x
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Comment 1 Tech-Tac 2025-06-14 20:49:59 UTC
Created attachment 182274 [details]
Distorted desktop after blindly logging in

Taken with a phone camera, this bug is not visible in screenshots.
Comment 2 Zamundaaa 2025-11-06 22:24:56 UTC
This is a driver bug. Switching to a tty and back triggers a modeset, which probably reset some driver state and 'fixes' the issue.

Please report this at https://gitlab.freedesktop.org/drm/amd/-/issues, but perhaps we can apply the same workaround for wakeup after suspend too.
Comment 3 Bug Janitor Service 2025-11-06 22:35:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8380
Comment 4 Zamundaaa 2025-11-07 17:32:25 UTC
Git commit 6c9744667a846758d8b2fff8f54cd98aa704f230 by Xaver Hugl.
Committed on 07/11/2025 at 16:34.
Pushed by zamundaaa into branch 'master'.

backends/drm: on legacy modesetting, trigger a modeset after suspend

In theory, the driver should handle it, but bugs in legacy modesetting aren't
super likely to be fixed anytime soon, and we already have the same workaround
for tty switches.

M  +13   -0    src/backends/drm/drm_backend.cpp

https://invent.kde.org/plasma/kwin/-/commit/6c9744667a846758d8b2fff8f54cd98aa704f230
Comment 5 Zamundaaa 2025-11-07 18:25:23 UTC
Git commit ef0054d9e4f0f240bcdab9e9b4728c45ff50ad2c by Xaver Hugl.
Committed on 07/11/2025 at 17:53.
Pushed by zamundaaa into branch 'Plasma/6.5'.

backends/drm: on legacy modesetting, trigger a modeset after suspend

In theory, the driver should handle it, but bugs in legacy modesetting aren't
super likely to be fixed anytime soon, and we already have the same workaround
for tty switches.


(cherry picked from commit 6c9744667a846758d8b2fff8f54cd98aa704f230)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +13   -0    src/backends/drm/drm_backend.cpp

https://invent.kde.org/plasma/kwin/-/commit/ef0054d9e4f0f240bcdab9e9b4728c45ff50ad2c