Bug 478860 - SDR Brightness slider affects HDR content
Summary: SDR Brightness slider affects HDR content
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.90.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-22 00:29 UTC by Jonathan Bennett
Modified: 2023-12-26 15:51 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bennett 2023-12-22 00:29:11 UTC
SUMMARY
While playing HDR videos with MPV, the brightness is all wrong and highlights are blown out, when using a very low SDR brightness setting in System Settings/Display & Monitor

STEPS TO REPRODUCE
1. Use "ENABLE_HDR_WSI=1 mpv --vo=gpu-next --target-colorspace-hint --gpu-api=vulkan --gpu-context=waylandvk" to play an HDR video on an HDR capable monitor
2. Turn the SDR Brightness slider in Display Configuration up and down
3. Watch the hilights blow out and the video look terrible


Operating System: Fedora Linux 40
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Kernel Version: 6.6.6-200.fc39.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6700 XT
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: X570 AORUS ELITE
System Version: -CF
Comment 1 Bug Janitor Service 2023-12-22 02:22:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4828
Comment 2 Zamundaaa 2023-12-22 12:36:57 UTC
Git commit 4425bcd4e0b98a91c3500afe7204fec22b9032f6 by Xaver Hugl.
Committed on 22/12/2023 at 13:28.
Pushed by zamundaaa into branch 'master'.

backends/drm: handle missing brightness values in the EDID better

Most importantly, fall back to an assumption of 1000 nits peak brightness when the
max brightness is missing, instead of the sdr brightness, which causes more immediately
visible issues.
Ideally the user should configure this value in the display settings, but it's too
late to still do that for Plasma 6.0.

M  +5    -8    src/backends/drm/drm_output.cpp
M  +10   -16   src/backends/drm/drm_pipeline.cpp
M  +4    -4    src/core/output.cpp
M  +7    -7    src/core/output.h
M  +24   -5    src/utils/edid.cpp
M  +13   -10   src/utils/edid.h
M  +3    -3    src/wayland/outputdevice_v2.cpp

https://invent.kde.org/plasma/kwin/-/commit/4425bcd4e0b98a91c3500afe7204fec22b9032f6
Comment 3 Jonathan Bennett 2023-12-22 20:31:06 UTC
(In reply to Zamundaaa from comment #2)
> Git commit 4425bcd4e0b98a91c3500afe7204fec22b9032f6 by Xaver Hugl.
> Committed on 22/12/2023 at 13:28.
> Pushed by zamundaaa into branch 'master'.
> 
> backends/drm: handle missing brightness values in the EDID better
> 
> Most importantly, fall back to an assumption of 1000 nits peak brightness
> when the
> max brightness is missing, instead of the sdr brightness, which causes more
> immediately
> visible issues.
> Ideally the user should configure this value in the display settings, but
> it's too
> late to still do that for Plasma 6.0.
> 
> M  +5    -8    src/backends/drm/drm_output.cpp
> M  +10   -16   src/backends/drm/drm_pipeline.cpp
> M  +4    -4    src/core/output.cpp
> M  +7    -7    src/core/output.h
> M  +24   -5    src/utils/edid.cpp
> M  +13   -10   src/utils/edid.h
> M  +3    -3    src/wayland/outputdevice_v2.cpp
> 
> https://invent.kde.org/plasma/kwin/-/commit/
> 4425bcd4e0b98a91c3500afe7204fec22b9032f6

Is this functionally equivalent to running "kscreen-doctor output.2.maxBrightnessOverride.1000" ?
Comment 4 Jonathan Bennett 2023-12-26 15:51:38 UTC
Managed to recompile Fedora's kwin with this patch, and can confirm it does fix the issue. Thanks!