Bug 508350

Summary: With HDR enabled switching to a TTY and back makes colors saturate and crush
Product: [Plasma] kwin Reporter: Kristian Buchman <littlegreendude55>
Component: colour-managementAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: aoeui, nate, xaver.hugl
Priority: NOR    
Version First Reported In: 6.4.4   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: phone photos of the screen hopefully showing the colors before and after reproducing the bug

Description Kristian Buchman 2025-08-16 15:43:26 UTC
Created attachment 184150 [details]
phone photos of the screen hopefully showing the colors before and after reproducing the bug

SUMMARY
With HDR enabled colors look wrong in that they heavily saturate and crush. I first noticed this on my Arch linux system where I routinely run kscreen-doctor --dpms off and occasionally I would wake the display up and see saturated and crushed colors. However, switching to TTY and back looks like the same issue and is easier to reproduce. I've also been able to reproduce on Neon.

STEPS TO REPRODUCE
1. Boot Neon Testing edition live cd
2. Enable HDR in display settings 
3. Switch to a tty and back

OBSERVED RESULT
Colors crush and saturate 

EXPECTED RESULT
Colors stay the same

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION
I am also able to reproduce on my archlinux system
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1

But was not able to reproduce on Neon User edition
KDE Plasma Version: 6.4.3
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.1

Screenshots taken while the bug is active look fine. To put colors back to normal just toggle HDR off and on. 

kscreen-doctor -o
Output: 1 DP-1 81a767ee-6d32-4beb-9768-8e23cb774ec2
	enabled
	connected
	priority 1
	DisplayPort
	replication source:0
	Modes:  1:2560x1440@144*!  2:2560x1440@120  3:2560x1440@100  4:2560x1440@60  5:1920x1200@144  6:1920x1080@75  7:1920x1080@60  8:1920x1080@60  9:1920x1080@60  10:1920x1080@50  11:1600x1200@144  12:1680x1050@60  13:1600x900@60  14:1280x1024@75  15:1280x1024@60  16:1440x900@144  17:1280x800@60  18:1152x864@60  19:1280x720@60  20:1280x720@60  21:1280x720@60  22:1280x720@50  23:1024x768@75  24:1024x768@60  25:800x600@75  26:800x600@60  27:720x480@60  28:720x480@60  29:640x480@75  30:640x480@60  31:640x480@60  32:640x480@60  33:1600x1200@60  34:1280x1024@144  35:1024x768@144  36:1920x1200@60  37:1280x800@144  38:1920x1080@144  39:1600x900@144  40:1368x768@60  41:1368x768@144  42:1280x720@144
	Geometry: 0,0 2560x1440
	Scale: 1
	Rotation: 1
	Overscan: 0
	Vrr: Automatic
	RgbRange: Automatic
	HDR: enabled
		SDR brightness: 343 nits
		SDR gamut wideness: 30%
		Peak brightness: 400 nits, overridden with: 400 nits
		Max average brightness: 344 nits
		Min brightness: 0.0984 nits
	Wide Color Gamut: enabled
	ICC profile: none
	Color profile source: sRGB
	Color power preference: prefer efficiency and performance
	Brightness control: supported, set to 100% and dimming to 100%
	DDC/CI: allowed
	Color resolution: automatic (10), range: [8; 16] bits per color
	Allow EDR: unsupported
Comment 1 Zamundaaa 2025-08-20 00:08:53 UTC
This is a driver bug, see https://gitlab.freedesktop.org/drm/amd/-/issues/4444
Comment 2 Zamundaaa 2025-08-20 21:12:50 UTC
Git commit d2df32c9c664023bb6a1409dbaecbd3078dbaaec by Xaver Hugl.
Committed on 20/08/2025 at 19:38.
Pushed by zamundaaa into branch 'master'.

backends/drm: work around amdgpu applying GAMMA_LUT in test-only commits

See https://gitlab.freedesktop.org/drm/amd/-/issues/4444 for details.
This does not cover up all the cases where the bug causes visible issues, but
it helps with the most annoying ones (at the cost of some performance during
brightness or color temperature animations).

For testing potential driver fixes, KWIN_DRM_DISABLE_AMD_GAMMA_WORKAROUND can
be set to 1 to disable this workaround.

M  +5    -1    src/backends/drm/drm_colorop.cpp

https://invent.kde.org/plasma/kwin/-/commit/d2df32c9c664023bb6a1409dbaecbd3078dbaaec
Comment 3 Zamundaaa 2025-08-20 21:59:22 UTC
Git commit 7d36003cb073ed2ad48b2743883db993106c347a by Xaver Hugl.
Committed on 20/08/2025 at 21:12.
Pushed by zamundaaa into branch 'Plasma/6.4'.

backends/drm: work around amdgpu applying GAMMA_LUT in test-only commits

See https://gitlab.freedesktop.org/drm/amd/-/issues/4444 for details.
This does not cover up all the cases where the bug causes visible issues, but
it helps with the most annoying ones (at the cost of some performance during
brightness or color temperature animations).

For testing potential driver fixes, KWIN_DRM_DISABLE_AMD_GAMMA_WORKAROUND can
be set to 1 to disable this workaround.


(cherry picked from commit d2df32c9c664023bb6a1409dbaecbd3078dbaaec)

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

M  +5    -1    src/backends/drm/drm_colorop.cpp

https://invent.kde.org/plasma/kwin/-/commit/7d36003cb073ed2ad48b2743883db993106c347a