Skip to content

Conversation

@cncz42
Copy link

@cncz42 cncz42 commented Sep 14, 2025

This should make it so kwin doesn't try to apply any additional tone mapping beyond a straight brightness adjustment whenever the SDR brightness is changed in KDE settings.

I'm very unfamiliar with wayland, in C especially, so this probably needs to be redone in a less janky way.

…n setting hdr metadata.

I'm very unfamiliar with wayland, in C especially, so this probably needs to be redone in a less janky way.
@cncz42 cncz42 changed the title Account for reference luminance adjustment by the compositor when setting hdr metadata. wayland: Account for reference luminance adjustment by the compositor when setting hdr metadata. Sep 14, 2025
@cncz42 cncz42 marked this pull request as draft September 14, 2025 04:17
@mahkoh
Copy link
Contributor

mahkoh commented Sep 14, 2025

The values in the luminances and the target_luminance events cannot be mixed in this way. For example, on my system the values are

		luminances (cd/m²): min 0.2000 max 80 reference 80
		target_luminances (cd/m²): min 0.0000 max 417

because I'm running my monitor in sRGB mode. If I change it to HDR10, the values are

		luminances (cd/m²): min 0.0000 max 10000 reference 203
		target_luminances (cd/m²): min 0.0000 max 417

The code in this PR would increase the max target luminance to 1058 in sRGB mode which is incorrect because the maximum supported nits of my display are 417.

@cncz42
Copy link
Author

cncz42 commented Sep 14, 2025

The values in the luminances and the target_luminance events cannot be mixed in this way. For example, on my system the values are

		luminances (cd/m²): min 0.2000 max 80 reference 80
		target_luminances (cd/m²): min 0.0000 max 417

because I'm running my monitor in sRGB mode. If I change it to HDR10, the values are

		luminances (cd/m²): min 0.0000 max 10000 reference 203
		target_luminances (cd/m²): min 0.0000 max 417

The code in this PR would increase the max target luminance to 1058 in sRGB mode which is incorrect because the maximum supported nits of my display are 417.

Might be a case of kwin-specific behavior here, then? Whenever reference luminance is adjusted below 203 there, it'll reduce the brightness of the content, so the 1058 max luminance would map to 417 (it seems to assume all HDR and SDR content have the same reference luminance). kwin SDR mode seems to always just skip metadata on my end. Either way, I do concede that my fix is kind of a hack.

@cncz42 cncz42 changed the title wayland: Account for reference luminance adjustment by the compositor when setting hdr metadata. wayland: account for reference luminance adjustment by the compositor Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants