Bug 495242

Summary: Acer XV275K P3 leaves HDR mode if I adjust any setting in Display Settings.
Product: [Plasma] kwin Reporter: laichiaheng
Component: colour-managementAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, regunakyle, xaver.hugl
Priority: NOR    
Version: 6.2.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.2.3
Sentry Crash Report:
Attachments: DRM_INFO_before
DRM_INFO_after

Description laichiaheng 2024-10-23 14:10:43 UTC
Created attachment 175144 [details]
DRM_INFO_before

SUMMARY
If I adjust the brightness in Plasma desktop, my monitor leaves the HDR mode.
Both monitor brightness and SDR brightness trigger this bug.

STEPS TO REPRODUCE
1. Adjust brightness from the system tray or the SDR brightness in system settings.
2. 
3. 

OBSERVED RESULT
My monitor leaves HDR mode, and become darker

EXPECTED RESULT
My monitor is still in HDR mode.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 6.2.1
KDE Plasma Version: 6.2.1
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0

ADDITIONAL INFORMATION
The kscreen-doctor -o before and after:

Before:
Output: 1 DP-2
        enabled
        connected
        priority 1
        DisplayPort
        Modes:  1:3840x2160@144!  2:3840x2160@60  3:3840x2160@160*  4:3840x2160@120  5:3840x2160@120  6:3840x2160@30  7:3840x2160@30  8:2560x1440@144  9:2560x1440@144  10:2560x1440@120  11:2560x1440@99  12:2560x1440@75  13:2560x1440@60  14:1920x1200@144  15:1920x1080@144  16:1920x1080@120  17:1920x1080@120  18:1920x1080@60  19:1920x1080@60  20:1920x1080@50  21:1600x1200@144  22:1680x1050@120  23:1680x1050@60  24:1280x1024@120  25:1280x1024@75  26:1280x1024@60  27:1440x900@120  28:1440x900@60  29:1280x800@144  30:1280x720@60  31:1280x720@60  32:1024x768@75  33:1024x768@60  34:800x600@75  35:800x600@60  36:720x576@50  37:720x480@60  38:720x480@60  39:640x480@75  40:640x480@60  41:640x480@60  42:640x480@60  43:720x400@70  44:1600x1200@60  45:1280x1024@60  46:1024x768@60  47:2560x1600@60  48:1920x1200@60  49:1280x800@60  50:3840x2160@60  51:3200x1800@60  52:2880x1620@60  53:2560x1440@60  54:1920x1080@60  55:1600x900@60  56:1368x768@60  57:1280x720@60 
        Geometry: 0,0 1920x1080
        Scale: 2
        Rotation: 1
        Overscan: 0
        Vrr: Automatic
        RgbRange: unknown
        HDR: enabled
                SDR brightness: 200 nits
                SDR gamut wideness: 0%
                Peak brightness: 1015 nits
                Max average brightness: 658 nits
                Min brightness: 0 nits
        Wide Color Gamut: enabled
        ICC profile: /home/laichiaheng/文件/rtings-icc-profile.icm
        Color profile source: ICC
        Brightness control: supported, set to 85%

After:
Output: 1 DP-2
        enabled
        connected
        priority 1
        DisplayPort
        Modes:  1:3840x2160@144!  2:3840x2160@60  3:3840x2160@160*  4:3840x2160@120  5:3840x2160@120  6:3840x2160@30  7:3840x2160@30  8:2560x1440@144  9:2560x1440@144  10:2560x1440@120  11:2560x1440@99  12:2560x1440@75  13:2560x1440@60  14:1920x1200@144  15:1920x1080@144  16:1920x1080@120  17:1920x1080@120  18:1920x1080@60  19:1920x1080@60  20:1920x1080@50  21:1600x1200@144  22:1680x1050@120  23:1680x1050@60  24:1280x1024@120  25:1280x1024@75  26:1280x1024@60  27:1440x900@120  28:1440x900@60  29:1280x800@144  30:1280x720@60  31:1280x720@60  32:1024x768@75  33:1024x768@60  34:800x600@75  35:800x600@60  36:720x576@50  37:720x480@60  38:720x480@60  39:640x480@75  40:640x480@60  41:640x480@60  42:640x480@60  43:720x400@70  44:1600x1200@60  45:1280x1024@60  46:1024x768@60  47:2560x1600@60  48:1920x1200@60  49:1280x800@60  50:3840x2160@60  51:3200x1800@60  52:2880x1620@60  53:2560x1440@60  54:1920x1080@60  55:1600x900@60  56:1368x768@60  57:1280x720@60 
        Geometry: 0,0 1920x1080
        Scale: 2
        Rotation: 1
        Overscan: 0
        Vrr: Automatic
        RgbRange: unknown
        HDR: enabled
                SDR brightness: 210 nits
                SDR gamut wideness: 0%
                Peak brightness: 1015 nits
                Max average brightness: 658 nits
                Min brightness: 0 nits
        Wide Color Gamut: enabled
        ICC profile: /home/laichiaheng/文件/rtings-icc-profile.icm
        Color profile source: ICC
        Brightness control: supported, set to 85%
Comment 1 laichiaheng 2024-10-23 14:11:21 UTC
Created attachment 175145 [details]
DRM_INFO_after
Comment 2 laichiaheng 2024-10-23 14:13:22 UTC
The hdr blog in drm_info changes.
Comment 3 laichiaheng 2024-10-23 14:18:25 UTC
If I adjust any of the setting in display setting
Comment 4 Zamundaaa 2024-10-23 16:32:41 UTC
hmm, the drm_info output shows the same HDR metadata being sent.

Does this still happen if you put
> POWERDEVIL_NO_DDCUTIL=1
into /etc/environment and reboot?
Comment 5 laichiaheng 2024-10-24 11:57:27 UTC
(In reply to Zamundaaa from comment #4)
> hmm, the drm_info output shows the same HDR metadata being sent.
> 
> Does this still happen if you put
> > POWERDEVIL_NO_DDCUTIL=1
> into /etc/environment and reboot?

It does not happen after I put this in /etc/environment.
Comment 6 Bug Janitor Service 2024-10-24 13:56:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6698
Comment 7 Zamundaaa 2024-10-24 14:44:19 UTC
Git commit 00f10569b3ade31f3df16982ff6d59f512463ba0 by Xaver Hugl.
Committed on 24/10/2024 at 14:35.
Pushed by zamundaaa into branch 'master'.

backends/drm: don't set backlight brightness to 1 in HDR mode

We haven't actually seen any reports that it's necessary on any screen, and it causes some weird
and broken screens to misbehave.

M  +4    -8    src/backends/drm/drm_output.cpp

https://invent.kde.org/plasma/kwin/-/commit/00f10569b3ade31f3df16982ff6d59f512463ba0
Comment 8 Zamundaaa 2024-10-24 15:02:50 UTC
Git commit e2d0bcb01e3e51258c3485d5e45d63eb54b6a551 by Xaver Hugl.
Committed on 24/10/2024 at 14:49.
Pushed by zamundaaa into branch 'Plasma/6.2'.

backends/drm: don't set backlight brightness to 1 in HDR mode

We haven't actually seen any reports that it's necessary on any screen, and it causes some weird
and broken screens to misbehave.
(cherry picked from commit 00f10569b3ade31f3df16982ff6d59f512463ba0)

M  +4    -12   src/backends/drm/drm_output.cpp

https://invent.kde.org/plasma/kwin/-/commit/e2d0bcb01e3e51258c3485d5e45d63eb54b6a551
Comment 9 regunakyle 2024-11-23 06:00:06 UTC
Hi, is this bug supposed to be fixed in Plasma 6.2.3 (as shown in the bugzilla)? Because I am still having this issue in 6.2.3.

For me, every time I boot up the machine, my monitor settings would reset back to default (I am not using HDR, but using sRGB color space). This was very frustrating. Luckily setting `POWERDEVIL_NO_DDCUTIL=1` does fix the issue.

Operating System: Fedora Linux 40
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.7.2
Kernel Version: 6.11.8-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa Intel® Arc
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: X570S AERO G
System Version: -CF
Comment 10 Nate Graham 2024-11-25 17:59:54 UTC
Sounds like a different issue.
Comment 11 Zamundaaa 2024-11-25 19:26:53 UTC
(In reply to regunakyle from comment #9)
> Hi, is this bug supposed to be fixed in Plasma 6.2.3 (as shown in the
> bugzilla)? Because I am still having this issue in 6.2.3.
> 
> For me, every time I boot up the machine, my monitor settings would reset
> back to default (I am not using HDR, but using sRGB color space). This was
> very frustrating. Luckily setting `POWERDEVIL_NO_DDCUTIL=1` does fix the
> issue.
> 
> Operating System: Fedora Linux 40
> KDE Plasma Version: 6.2.3
> KDE Frameworks Version: 6.8.0
> Qt Version: 6.7.2
> Kernel Version: 6.11.8-200.fc40.x86_64 (64-bit)
> Graphics Platform: Wayland
> Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
> Memory: 31.2 GiB of RAM
> Graphics Processor: Mesa Intel® Arc
> Manufacturer: Gigabyte Technology Co., Ltd.
> Product Name: X570S AERO G
> System Version: -CF

Please report that to powerdevil. I think we'll have to just add a blacklist with known broken screens and disable DDC entirely with them.