Skip to content

Simplify and fix hdr metadata setting#9706

Merged
vaxerski merged 2 commits into
hyprwm:mainfrom
UjinT34:simplify-cm-pass
Mar 24, 2025
Merged

Simplify and fix hdr metadata setting#9706
vaxerski merged 2 commits into
hyprwm:mainfrom
UjinT34:simplify-cm-pass

Conversation

@UjinT34

@UjinT34 UjinT34 commented Mar 23, 2025

Copy link
Copy Markdown
Contributor

Describe your PR, what does it fix/add?

Fixes unwanted switch to SDR for fullscreen apps with CM support when cm_fs_passthrough=2 (foot should no longer cause a modeset)
Fixes metadata creation. Primaries weren't sent correctly. Doesn't seem to have any effect on nvidia, other drivers might have some color improvements (need some info on how those values should be handled by the driver)
Sends primaries and luminances info for SDR content in case it'll be useful for fixing SDR passthrough on AQ side. Might make sense to set a hdr metadata blob with SDR eotf if those primaries and luminances are handled by the driver.
Simplifies hdr metadata switching logic

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

CM skip for rendering without a surface data should be removed. E verything that doesn't explicitly set an image description is considered sRGB and should go through the CM if monitor isn't in sRGB. If there are cases when renderTextureInternalWithDamage is called without a surface and the provided texture is encoded the same way then there should be a way to provide this info explicitly. Image description should be set on a CTexture level probably. Keeping it as is till #9600

Is it ready for merging, or does it need work?

Ready

@vaxerski vaxerski merged commit a852461 into hyprwm:main Mar 24, 2025
@aruhier

aruhier commented Mar 24, 2025

Copy link
Copy Markdown
Contributor

@UjinT34, sorry I use this PR to ask this question, as it's related to cm_fs_passthrough. Can you add more details in the wiki about this variable?

It's written that it's a boolean set by default to true, but if I understand correctly, it's more a int 0/1/2 option. For example, even with this patch, foot in fullscreen applies a wrong color mapping with cm_fs_passthrough = 1 (or true), but is correct with cm_fs_passthrough = 2. What is the difference between 1 and 2?

@UjinT34

UjinT34 commented Mar 24, 2025

Copy link
Copy Markdown
Contributor Author

Looks like site is outdated https://github.com/hyprwm/hyprland-wiki/blob/main/pages/Configuring/Variables.md
1 is bugged for fullscreen sdr apps. If your monitor is in hdr mode you should use cm_fs_passthrough = 0. If it's in sdr mode cm_fs_passthrough = 2 will auto-switch to hdr when there is a fullscreen hdr app.
Fullscreen hdr apps might look different with cm_fs_passthrough = 0 and cm_fs_passthrough = 1 or 2. The former will apply the CM shader, the latter will send the content as is.

@aruhier

aruhier commented Mar 24, 2025

Copy link
Copy Markdown
Contributor

Perfect, thanks so much for the explanations!

Sorry I missed it, I didn't notice that the wiki set on git was outdated. I'm creating an issue for hyprland-wiki.

Dregu pushed a commit to Dregu/Hyprland that referenced this pull request Mar 28, 2025
* simplify and fix hdr metadata setting

* keep incorrect(?) cm skip till hyprwm#9600
vaxerski pushed a commit that referenced this pull request Mar 28, 2025
* simplify and fix hdr metadata setting

* keep incorrect(?) cm skip till #9600
crthpl pushed a commit to crthpl/Hyprland that referenced this pull request Jun 3, 2026
* simplify and fix hdr metadata setting

* keep incorrect(?) cm skip till hyprwm#9600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants