Bug 480648 - Display Stuck in HDR After Disabling HDR
Summary: Display Stuck in HDR After Disabling HDR
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.93.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-01 00:04 UTC by theriverlethe@gmail.com
Modified: 2024-03-18 23:11 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Photo of screen showing HDR disabled in display settings but screen still in HDR mode. (1.66 MB, image/jpeg)
2024-02-01 00:04 UTC, theriverlethe@gmail.com
Details
drm_info before enabling HDR (102.27 KB, text/plain)
2024-02-01 00:56 UTC, theriverlethe@gmail.com
Details
drm_info after enabling HDR (103.66 KB, text/plain)
2024-02-01 00:57 UTC, theriverlethe@gmail.com
Details
drm_info after disabling HDR (102.95 KB, text/plain)
2024-02-01 00:57 UTC, theriverlethe@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description theriverlethe@gmail.com 2024-02-01 00:04:34 UTC
Created attachment 165416 [details]
Photo of screen showing HDR disabled in display settings but screen still in HDR mode.

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

STEPS TO REPRODUCE
1. Enable HDR through "display settings.
2. Disable HDR through "display settings."
3. File bug report. 

OBSERVED RESULT

Graphical output returns to SDR but the display is still stuck in HDR mode, with severely degraded image quality. 

EXPECTED RESULT

Display returns to SDR mode. 

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: CachyOS with latest updates and kde-unstable repo
(available in About System)
KDE Plasma Version: 5.93
KDE Frameworks Version: 5.249
Qt Version: 6.7.0

ADDITIONAL INFORMATION

AMD 7900XT GPU with LG C2 OLED display and DP -> HDMI adapter.
Comment 1 Zamundaaa 2024-02-01 00:23:25 UTC
Please attach the output of drm_info before enabling HDR, after enabling HDR, and after disabling HDR again.
Comment 2 theriverlethe@gmail.com 2024-02-01 00:56:23 UTC
Created attachment 165418 [details]
drm_info before enabling HDR
Comment 3 theriverlethe@gmail.com 2024-02-01 00:57:12 UTC
Created attachment 165419 [details]
drm_info after enabling HDR
Comment 4 theriverlethe@gmail.com 2024-02-01 00:57:35 UTC
Created attachment 165420 [details]
drm_info after disabling HDR
Comment 5 theriverlethe@gmail.com 2024-02-01 01:00:30 UTC
Note that there is a second monitor attached on another DP port, but it's disabled in "display settings."
Comment 6 Zamundaaa 2024-02-01 18:12:11 UTC
Okay, KWin is correctly setting HDR_OUTPUT_METADATA to 0 and Colorspace to Default, so this is either the display behaving funky and needing HDR_OUTPUT_METADATA that tells it to turn off HDR explicitly, or it's a driver bug.
What kernel version are you on?
Comment 7 theriverlethe@gmail.com 2024-02-01 18:44:52 UTC
6.7.2

I ordered another adapter to try tomorrow, so we'll see if that's any different. The reason I filed a bug report is that HDR switching works perfectly on Windows, although I noticed that DSC is enabled by default and I have no idea how to force enable it on Linux.
Comment 8 theriverlethe@gmail.com 2024-02-03 00:14:10 UTC
Cable Matters adapters doesn't work at all at 120Hz, so that can be disregarded.
Comment 9 theriverlethe@gmail.com 2024-02-10 01:22:13 UTC
A Cable Matters adapter with firmware patched from https://gitlab.freedesktop.org/drm/amd/-/issues/1417 seems to have the opposite problem. The display (LG C2 OLED) will switch to SDR if kwin is loaded with HDR turned on, but will not switch to HDR after switching to SDR. Why is there not explicit HDR_OUTPUT_METADATA being sent?
Comment 10 theriverlethe@gmail.com 2024-02-10 01:40:21 UTC
(In reply to theriverlethe@gmail.com from comment #9)
> A Cable Matters adapter with firmware patched from
> https://gitlab.freedesktop.org/drm/amd/-/issues/1417 seems to have the
> opposite problem. The display (LG C2 OLED) will switch to SDR if kwin is
> loaded with HDR turned on, but will not switch to HDR after switching to
> SDR. Why is there not explicit HDR_OUTPUT_METADATA being sent?

Disregard some of this comment. The Cable Matters adapter will not switch to HDR at all.
Comment 11 Bug Janitor Service 2024-02-25 03:46:19 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 Evan 2024-03-17 00:04:10 UTC
I'm also seeing this with my Innocn 27m2v, but it doesn't switch between HDR and SDR in either direction. It works fine in Windows. I also have 2 Gigabyte m28u monitors that switch correctly on Linux.

HDR set in Plasma:  Colorspace: BT2020_RGB,  HDR_OUTPUT_METADATA: 144
HDR disabled in Plasma: Colorspace: Default, HDR_OUTPUT_METADATA: 0

Monitor mode makes no difference in drm_info Colorspace/HDR_OUTPUT_METADATA

Plasma 6.0.2
Arch Linux
Kernel 6.8.1-zen1-1-zen
Comment 13 Matej Mrenica 2024-03-18 09:31:19 UTC
The issue of sddm or other sessions or Plymouth being oversaturated after using Plasma with HDR, is the same issue as this or is that a separate one?
Like when I log out of Plasma, HDR should be disabled or there should be a signal to the monitor that the following content is no longer HDR.
Comment 14 Zamundaaa 2024-03-18 23:11:34 UTC
Switching between applications that control the screen with different capabilities is a more general issue in Linux; if you run SDDM with Xorg, Xorg simply doesn't understand HDR, and that includes not understanding how to turn it off. If you run SDDM on kwin_wayland, that issue will go away.

As for the other issues, as long as drm_info tells you the correct properties are being set, KWin is doing everything correctly. Please report them to your driver vendor; with AMD the right place for that would be https://gitlab.freedesktop.org/drm/amd/-/issues and with NVidia https://github.com/NVIDIA/open-gpu-kernel-modules/issues