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 UPSTREAM    
Severity: normal CC: nate, sephiroth_pk, 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 unlocking after sleep
welp...

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 unlocking after sleep

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
Comment 6 Zamundaaa 2025-11-27 13:58:55 UTC
*** Bug 506814 has been marked as a duplicate of this bug. ***
Comment 7 Tech-Tac 2025-12-03 18:07:04 UTC
Created attachment 187323 [details]
welp...

well, this is awkward :/
Comment 8 Tech-Tac 2025-12-03 18:08:19 UTC
I will reopen this for now. Here are my versions and stuff:

Operating System: Arch Linux 
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.1
Kernel Version: 6.17.9-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 4 × AMD A8-5500B APU with Radeon(tm) HD Graphics
Memory: 8 GiB of RAM (7.0 GiB usable)
Graphics Processor: AMD ARUBA

Actual Graphics Processor: Radeon HD 7560D
Kernel Driver in Use: radeon
Comment 9 Tech-Tac 2025-12-03 18:11:35 UTC
This happened today after the device went to sleep after the configured idle timer, but I could also reproduce it afterwards with manually suspending the machine, but now combined with a possibly related issue that the screen is black (but on) initially and only appears after moving the mouse.
Comment 10 Zamundaaa 2025-12-05 14:35:02 UTC
Sorry, but if the modeset doesn't help, then there's nothing more we can realistically do about it.