Bug 498616 - Built-In Color Profile turns screen black in Wayland session
Summary: Built-In Color Profile turns screen black in Wayland session
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kwin
Classification: Plasma
Component: colour-management (show other bugs)
Version: 6.2.5
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-13 17:17 UTC by Danie de Jager
Modified: 2025-01-18 12:56 UTC (History)
2 users (show)

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


Attachments
Display setting where "Color Profile" can be found. (14.53 KB, image/png)
2025-01-13 17:19 UTC, Danie de Jager
Details
drm-info output (117.56 KB, application/json)
2025-01-18 12:52 UTC, Danie de Jager
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Danie de Jager 2025-01-13 17:17:36 UTC
SUMMARY
I have an older Macbook Pro 2012 with a 1280x800 Screen. I change the Color Profile to "Built-in" which turns the screen black until the timeout occurs and the setting reverts. If you do not wait to revert and force a restart, then from there onward the Wayland session will have a black screen as soon as you login. The X11 screen is not affected but also do not seem to support the Color Profile as it is not an option under KScreen in a X11 session. 

STEPS TO REPRODUCE
1.  Go to "Display Configuration" while using the Wayland session.
2.  Select "Color Profile" and change to "Built-in"
3.  Screen goes black and eventually reverts. If not then the screen will remain black after restarts until you delete "~/.config/kwinoutputconfig.json" from the still working X11 session. 

OBSERVED RESULT
This issue only affects my Wayland session. 

EXPECTED RESULT
1. The screen should not black out.
2. I thought there is no timeout revert happening so I forced a reboot which permanently set the screen's new value. I'd expect the new value to only set once I confirmed it as I could see to click a confirm button.
3. The timeout could  be a little shorter? 

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.8.0-51-generic (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-3210M CPU @ 2.50GHz
Memory: 9.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4000

ADDITIONAL INFORMATION
Section "Monitor"
	Identifier ""
	ModelName ""
	VendorName "APP"
	# Monitor Manufactured week 28 of 2009
	# EDID version 1.3
	# Digital Display
	DisplaySize 290 180
	Gamma 2.20
	Option "DPMS" "false"
	Modeline 	"Mode 0" -hsync -vsync
Comment 1 Danie de Jager 2025-01-13 17:19:59 UTC
Created attachment 177323 [details]
Display setting where "Color Profile" can be found.
Comment 2 Zamundaaa 2025-01-15 15:32:55 UTC
Please attach the output of
> edid-decode /sys/class/drm/card1-eDP-1/edid
the card number and maybe connector name might need adjusting to be about a valid file

Most likely, the color information in the profile is unusable. We should detect that situation and hide the option entirely when that's the case.

> I thought there is no timeout revert happening so I forced a reboot which permanently set the screen's new value. I'd expect the new value to only set once I confirmed it as I could see to click a confirm button.
Please open a separate bug report about that; this should be doable but is rather complicated.

> The timeout could  be a little shorter? 
Unfortunately some screens take a long time to switch modes, making the timeout shorter would make it impossible to use those.
Comment 3 Bug Janitor Service 2025-01-15 17:31:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7016
Comment 4 Zamundaaa 2025-01-16 11:00:03 UTC
Git commit 037d710b3d656e873a001ed479695c8b8463a33e by Xaver Hugl.
Committed on 16/01/2025 at 10:30.
Pushed by zamundaaa into branch 'master'.

utils/edid: check if colorimetry could possibly be correct

With invalid colorimetry, selecting the "built-in" color profile could otherwise cause
a black screen or glitches.

M  +14   -6    src/utils/edid.cpp

https://invent.kde.org/plasma/kwin/-/commit/037d710b3d656e873a001ed479695c8b8463a33e
Comment 5 Danie de Jager 2025-01-16 15:38:11 UTC
(In reply to Zamundaaa from comment #2)
> Please attach the output of
> > edid-decode /sys/class/drm/card1-eDP-1/edid
> the card number and maybe connector name might need adjusting to be about a
> valid file
> 
> Most likely, the color information in the profile is unusable. We should
> detect that situation and hide the option entirely when that's the case.
> 
> > I thought there is no timeout revert happening so I forced a reboot which permanently set the screen's new value. I'd expect the new value to only set once I confirmed it as I could see to click a confirm button.
> Please open a separate bug report about that; this should be doable but is
> rather complicated.
> 
> > The timeout could  be a little shorter? 
> Unfortunately some screens take a long time to switch modes, making the
> timeout shorter would make it impossible to use those.

Theses are from my Macbook:
```
edid-decode /sys/class/drm/card1-
card1-DP-1/     card1-DP-2/     card1-DP-3/     card1-HDMI-A-1/ card1-HDMI-A-2/ card1-HDMI-A-3/ card1-LVDS-1/   card1-VGA-1/
```
I don't have a `/sys/class/drm/card1-eDP-1/edid`
Comment 6 Vlad Zahorodnii 2025-01-16 17:02:24 UTC
Git commit d02b39b2a8a4a824c0c67a68afada31f51fa5b30 by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 16/01/2025 at 16:21.
Pushed by vladz into branch 'Plasma/6.3'.

utils/edid: check if colorimetry could possibly be correct

With invalid colorimetry, selecting the "built-in" color profile could otherwise cause
a black screen or glitches.
(cherry picked from commit 037d710b3d656e873a001ed479695c8b8463a33e)

M  +14   -6    src/utils/edid.cpp

https://invent.kde.org/plasma/kwin/-/commit/d02b39b2a8a4a824c0c67a68afada31f51fa5b30
Comment 7 Zamundaaa 2025-01-16 17:23:01 UTC
(In reply to Danie de Jager from comment #5)
> Theses are from my Macbook:
> ```
> edid-decode /sys/class/drm/card1-
> card1-DP-1/     card1-DP-2/     card1-DP-3/     card1-HDMI-A-1/
> card1-HDMI-A-2/ card1-HDMI-A-3/ card1-LVDS-1/   card1-VGA-1/
> ```
> I don't have a `/sys/class/drm/card1-eDP-1/edid`
In that case, you need to use
> edid-decode /sys/class/drm/card1-LVDS-1
Comment 8 Danie de Jager 2025-01-17 17:03:11 UTC
(In reply to Zamundaaa from comment #7)
> (In reply to Danie de Jager from comment #5)
> > Theses are from my Macbook:
> > ```
> > edid-decode /sys/class/drm/card1-
> > card1-DP-1/     card1-DP-2/     card1-DP-3/     card1-HDMI-A-1/
> > card1-HDMI-A-2/ card1-HDMI-A-3/ card1-LVDS-1/   card1-VGA-1/
> > ```
> > I don't have a `/sys/class/drm/card1-eDP-1/edid`
> In that case, you need to use
> > edid-decode /sys/class/drm/card1-LVDS-1
That was Empty:
> $ edid-decode /sys/class/drm/card1-LVDS-1
> EDID of '/sys/class/drm/card1-LVDS-1' was empty.
Comment 9 Zamundaaa 2025-01-17 21:27:07 UTC
huh, that's unexpected. What's the output of drm_info?
Comment 10 Danie de Jager 2025-01-18 12:52:50 UTC
Created attachment 177504 [details]
drm-info output
Comment 11 Danie de Jager 2025-01-18 12:54:15 UTC
(In reply to Danie de Jager from comment #10)
> Created attachment 177504 [details]
> drm-info output

I attached json output.
Comment 12 Danie de Jager 2025-01-18 12:56:36 UTC
(In reply to Zamundaaa from comment #9)
> huh, that's unexpected. What's the output of drm_info?

Attached.