Bug 499103 - Some HDR scRGB games are broken in fullscreen
Summary: Some HDR scRGB games are broken in fullscreen
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 6.2.91
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-24 19:10 UTC by Amine Hassane
Modified: 2025-02-15 12:27 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amine Hassane 2025-01-24 19:10:42 UTC
SUMMARY
Some games that use scRGB (VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT) in HDR are limited to SDR luminance levels when fullscreen, causing a blown out image. However, when the game is not fullscreen (using the Meta+F shortcut) HDR works normally. It also works if the game fully covers the screen (auto hide panel, no borders) but is not fullscreen.

STEPS TO REPRODUCE
1. Play a game that uses scRGB in HDR (e.g. Assassin's Creed Odyssey, Cyberpunk with the HDR Mode set to scRGB, Star Wars Jedi: Fallen Order).
2. Ensure the game is fullscreen.
3. Enable HDR in the game's settings.

OBSERVED RESULT
Highlights are clipped as if limited to SDR levels.

EXPECTED RESULT
HDR works normally.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.2.91
KDE Frameworks Version: 6.10
Qt Version: 6.9.0beta2

ADDITIONAL INFORMATION
- The issue also occurs with KWin 6.2.5.
- The issue occurs with both gamescope and native wayland. 
- Hot Wheels Unleashed is an HDR scRGB game but does not exhibit this issue.
Comment 1 Bug Janitor Service 2025-01-25 02:02:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7058
Comment 2 Amine Hassane 2025-01-25 05:42:07 UTC
That fixes the bug. Thanks!
Comment 3 Zamundaaa 2025-01-25 12:50:02 UTC
Git commit 62196bf736feb6814661dd8154fa1b46c48eb2db by Xaver Hugl.
Committed on 25/01/2025 at 02:01.
Pushed by zamundaaa into branch 'master'.

backends/drm: don't use LUTs for scaling anything outside of the [0; 1] range

They clamp input and output values to that range, so they're not usable for that purpose.

M  +3    -0    src/backends/drm/drm_colorop.cpp

https://invent.kde.org/plasma/kwin/-/commit/62196bf736feb6814661dd8154fa1b46c48eb2db
Comment 4 Bug Janitor Service 2025-01-25 12:58:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7060
Comment 5 Zamundaaa 2025-01-25 13:53:37 UTC
Git commit 888deff8c65dd46bf6df9d00fb8022bc1779f793 by Xaver Hugl.
Committed on 25/01/2025 at 12:50.
Pushed by zamundaaa into branch 'Plasma/6.3'.

backends/drm: don't use LUTs for scaling anything outside of the [0; 1] range

They clamp input and output values to that range, so they're not usable for that purpose.


(cherry picked from commit 62196bf736feb6814661dd8154fa1b46c48eb2db)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +3    -0    src/backends/drm/drm_colorop.cpp

https://invent.kde.org/plasma/kwin/-/commit/888deff8c65dd46bf6df9d00fb8022bc1779f793
Comment 6 Amine Hassane 2025-01-26 07:23:56 UTC
I guess it's a different bug but that second MR fixes the overly bright look of scRGB games. I wasn't experiencing it before because I using a patch to restore the pass through behavior of 6.2.
Comment 7 Zamundaaa 2025-01-26 19:14:52 UTC
Git commit fb695ba708fa0d2f96118a548d59ee6805620743 by Xaver Hugl.
Committed on 25/01/2025 at 12:58.
Pushed by zamundaaa into branch 'master'.

wayland/frog color management: use a reference luminance of 203 nits for scRGB

80 nits is correct, but Windows doesn't do correct, and with the frog protocol we know
we're getting the image from a game using Windows scRGB. 203 nits is what we use for PQ,
so this will ensure that PQ and scRGB modes in games look roughly the same.

M  +16   -1    src/wayland/frog_colormanagement_v1.cpp

https://invent.kde.org/plasma/kwin/-/commit/fb695ba708fa0d2f96118a548d59ee6805620743
Comment 8 Bug Janitor Service 2025-01-26 19:15:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7062
Comment 9 Zamundaaa 2025-01-26 19:30:14 UTC
Git commit 388436ea64c57106d9027f29354a445aa4f43c00 by Xaver Hugl.
Committed on 26/01/2025 at 19:15.
Pushed by zamundaaa into branch 'Plasma/6.3'.

wayland/frog color management: use a reference luminance of 203 nits for scRGB

80 nits is correct, but Windows doesn't do correct, and with the frog protocol we know
we're getting the image from a game using Windows scRGB. 203 nits is what we use for PQ,
so this will ensure that PQ and scRGB modes in games look roughly the same.


(cherry picked from commit fb695ba708fa0d2f96118a548d59ee6805620743)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +16   -1    src/wayland/frog_colormanagement_v1.cpp

https://invent.kde.org/plasma/kwin/-/commit/388436ea64c57106d9027f29354a445aa4f43c00
Comment 10 Amine Hassane 2025-02-15 12:27:32 UTC
This issue has been reintroduced with https://invent.kde.org/plasma/kwin/-/commit/5453662f9cd4816e4b046beb0c7df5a676a3df7c, but only in two of the games I tested: AC Odyssey and Cyberpunk. It also also broke scanout in PQ apps.