Repository navigation
Conversation
The HDR10 mastering display primaries and white point (units of 0.00002)
were rescaled to wp-color-management units (1e-6) with
`(int32_t)x * 1'000'000 / 0xC350`, which overflows int32 for any value
above ~2147. Compositors therefore received garbage, often negative,
chromaticities, e.g. for BT.2020/D65 metadata:
set_mastering_display_primaries(20805, 34301, -1798, 23905,
-40798, -39899, -30897, -14597)
instead of (708000, 292000, 170000, 797000, 131000, 46000, 312700,
329000). KWin 6.8 derives the clip range and tone mapping from the
mastering volume, which clipped HDR10 content to SDR in nested gamescope.
Do the multiplication in 64-bit before narrowing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
If you don't understand the code in a pull request you're making, don't post it. |
Collaborator
|
if you find real bugs, please just report them using the template. the burden of sifting through llm output to try and find actual bugs is a lot easier if you just keep things short and simple in an issue, in particular steps to reproduce the issue. |
Author
|
Yeah you're right my bad. I do have a real bug which this fixed (for me at least) Will create an issue now. |
3 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was written entirely by an AI (Claude Code). I (Delivator) don't have technical knowledge here — I just want to play games in HDR and I'm happy if this helps. I tested it on my machine and can provide logs.
The mastering display primaries are rescaled from 0.00002 to 1e-6 units in 32-bit, which overflows (
35400 * 1'000'000). Compositors get garbage, often negative, chromaticities:On KDE Plasma 6.8.1 (nested,
--hdr-enabled, HDR10 game) this clipped the picture to SDR; with the fix HDR works again.Related: #2091.
🤖 Generated with Claude Code