Bug 500455

Summary: Display freezes upon opening fullscreen views if both HDR and "Prefer color accuracy" are enabled
Product: [Plasma] kwin Reporter: 43615 <xxx43615xxx>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: postix, xaver.hugl, xxx43615xxx
Priority: NOR    
Version First Reported In: 6.3.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot of settings page

Description 43615 2025-02-20 12:04:34 UTC
SUMMARY
My primary display is a 3840x2160@120 panel with HDR. If I enable both HDR and the recently added "Prefer color accuracy" option, opening KWin's Overview feature will cause it to freeze on the current frame. Upon closing the Overview, it flickers for a few frames and resumes functioning as normal. Disabling HDR and/or color accuracy stops this from happening.

STEPS TO REPRODUCE
1. Configure a display to use both HDR and "Prefer color accuracy", IDK if resolution/refresh rate is important
2. Ensure a keyboard shortcut is configured (Shortcuts > System Services > KWin > Toggle Overview)
3. Try to open Overview

OBSERVED RESULT
Overview only opens on my secondary screens (non-HDR). Primary screen freezes until Overview is closed.

EXPECTED RESULT
Overview should work on all screens.

SOFTWARE/OS VERSIONS
Linux kernel: 6.13.3-arch1
KDE Plasma Version: 6.3.1
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
mesa 24.3.4
wayland 1.23.1
wlroots 0.18.2

ADDITIONAL INFORMATION
Display in question is an Acer XB273KGP running through a Radeon 7900 XTX.
Comment 1 Zamundaaa 2025-02-20 14:49:44 UTC
Works fine for me, also on a 7900XTX.

Is there anything suspicious in the logs after you trigger this issue?
> journalctl --user-unit plasma-kwin_wayland --boot 0
Comment 2 43615 2025-02-20 14:57:32 UTC
(In reply to Zamundaaa from comment #1)
> Works fine for me, also on a 7900XTX.
> 
> Is there anything suspicious in the logs after you trigger this issue?
> > journalctl --user-unit plasma-kwin_wayland --boot 0

Yes, it creates this entry:
kwin_scene_opengl: Could not delete texture because no context is current
Comment 3 Zamundaaa 2025-02-20 15:04:31 UTC
Hmm, I also sometimes see that after closing the overview. Not sure if it's related.
Comment 4 43615 2025-02-20 15:25:31 UTC
The entry doesn't appear when I disable color accuracy to prevent the bug, so it seems strongly correlated. Is your display setup the same as mine?
Comment 5 43615 2025-02-20 15:26:43 UTC
oops, fixed status
Comment 6 43615 2025-02-20 16:56:26 UTC
Created attachment 178651 [details]
Screenshot of settings page

Secondary monitors are non-HDR
Comment 7 Zamundaaa 2025-03-05 16:27:47 UTC
(In reply to 43615 from comment #4)
> The entry doesn't appear when I disable color accuracy to prevent the bug,
> so it seems strongly correlated. Is your display setup the same as mine?
It only happens sometimes here, might just be racy.

This is relatively likely to be a core KWin issue, but just to make sure, can you record a drm debug log (https://invent.kde.org/plasma/kwin/-/wikis/Debugging/Debugging-DRM-issues) for when you open the overview?
Comment 8 43615 2025-03-05 16:38:22 UTC
It happens consistently for me.

I just triggered the freeze 3 times while logging. Attachment follows.
Comment 9 43615 2025-03-05 16:41:17 UTC
File is too big, here's a link to it on my server:

https://webdav.43615.xyz/pub/drm-debug.log
Comment 10 Zamundaaa 2025-03-05 21:50:07 UTC
There's a consistent amount of "committing ... nonblocking" that we can safely assume the drm backend is doing fine, and the issue is somewhere in rendering.

Do other fullscreen effects work, like the tiling editor (Meta+T by default)? If you drag a window to maximize it, does that preview thing cause any issues?
Comment 11 43615 2025-03-06 13:54:33 UTC
The tiling editor causes the exact same issue. I'm not sure which maximizing preview you mean, my setup displays a dark overlay which works fine.
Comment 12 Zamundaaa 2025-03-10 22:37:26 UTC
(In reply to 43615 from comment #11)
> The tiling editor causes the exact same issue. I'm not sure which maximizing
> preview you mean, my setup displays a dark overlay which works fine.
Yeah I meant that one. So it's only fullscreen QtQuick effects specifically, and not all internal Qt windows. That's good to know.

Most likely blitting the effect contents to the screen just doesn't happen for some reason... There are a handful of error paths that should never happen, but perhaps sprinkling in some logging could help.
Comment 13 Bug Janitor Service 2025-03-10 22:44:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7301
Comment 14 Vlad Zahorodnii 2025-03-11 16:10:20 UTC
Git commit f681af2e5fe0b6c51932cca1b95537e1e236333e by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 11/03/2025 at 12:30.
Pushed by vladz into branch 'master'.

effect/offscreenquickview: add some warnings for when painting will be skipped

The screen will visually freeze if this happens

M  +5    -0    src/effect/offscreenquickview.cpp

https://invent.kde.org/plasma/kwin/-/commit/f681af2e5fe0b6c51932cca1b95537e1e236333e
Comment 15 Bug Janitor Service 2025-03-11 17:41:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7314
Comment 16 Vlad Zahorodnii 2025-03-12 07:09:37 UTC
Git commit d7241f9bdb63240563e72c2d4d5d6718f8a76fe0 by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 12/03/2025 at 06:39.
Pushed by vladz into branch 'Plasma/6.3'.

effect/offscreenquickview: add some warnings for when painting will be skipped

The screen will visually freeze if this happens


(cherry picked from commit f681af2e5fe0b6c51932cca1b95537e1e236333e)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +5    -0    src/effect/offscreenquickview.cpp

https://invent.kde.org/plasma/kwin/-/commit/d7241f9bdb63240563e72c2d4d5d6718f8a76fe0
Comment 17 43615 2025-04-07 06:50:30 UTC
Persists in kwin 6.3.4
Comment 18 43615 2025-04-07 06:51:00 UTC
Persists in kwin 6.3.4, what was that commit about?
Comment 19 Zamundaaa 2025-04-07 14:22:55 UTC
The commit isn't there for fixing it, as we don't know the cause yet. If you're hitting any of the code paths where this sort of thing could potentially happen, it should print about it in your log (journalctl --user-unit plasma-kwin_wayland --boot 0)
Comment 20 43615 2025-04-08 10:32:19 UTC
I'm not seeing any journal entries, even with -p 7.