What's the transfer function for SDR content under HDR mode

Seems we don’t have any document about this for kwin. Macos has a nice setting for this, can we do the same for kwin? GitHub - dylanraga/win11hdr-srgb-to-gamma2.2-icm: Transform Windows 11's virtual SDR-in-HDR curve from piecewise sRGB to Gamma 2.2

@Zamundaaa Also is it possible to apply ICC data for SDR contents when HDR is enabled?

You don’t need that, KWin handles sRGB content correctly without hacks - using the gamma 2.2 transfer function

@Zamundaaa Thanks for reply. But seems we doesn’t have solutions to override EDID-provided information when that’s wrong under HDR, unless we override EDID in kernel command line?

Also, can we have MHC2 tag supported for HDR calibration?

Besides, current implementation is to directly apply gamma 2.2 EOTF on sRGB contents, is my understanding right?

We do, there’s just no UI for it yet.

kscreen-doctor output.1.minBrightnessOverride.value (generally shouldn't be used tho)
kscreen-doctor output.1.maxAverageBrightnessOverride.value (or .disable)
kscreen-doctor output.1.maxBrightnessOverride.value (or .disable)

I haven’t looked into it yet, not sure we need it. The calibration page I’m working on sets the native KWin settings for it.

What do you mean? With “directly” specifically`?

1 Like

I mean when displaying sRGB contents on non-srgb monitors, I assume that we use 2.2 EOTF to convert sRGB to XYZ(or maybe something else) space, then we use monitor profile to convert XYZ content to monitor space. Am I right?

Btw I found that seems Apple is doing the same as sRGB for their Display P3. They also mark monitor as sRGB transfer function but physically using power 2.2 on monitors.

Forget about my previous reply. I have checked the TRC tag data in mac’s monitor icc file, and found that it’s calibrated to power 2.4 gamma curve.

The intermediary colorspace isn’t XYZ, but yes, that’s roughly how it works.

1 Like

Thanks, and I’m curious what blending space are KWin using?

More tests and re-calculation proves my previous result about Mac is wrong. Mac actually calibrates the panel to power 2.2 TRC and reports as sRGB TRC: sRGB vs. ICC (#30) · Issues · Pekka Paalanen / color-and-hdr · GitLab

It depends on the display. We use a gamma 2.2 transfer function with minimum and maximum luminance of the screen as 0 and 1 respectively.

1 Like

Seems MHC2 is basically a mix of multiple existing tags. The only usage for it under Linux is to load factory calibration for some laptops. Btw MHC2 ICCs are all calibrated to gamma2.2(described at the end of readme: GitHub - dantmnf/MHC2: information about next generation color management in Windows)

@Zamundaaa I remember you said in mpv PR that kwin didn’t implement the protocol that can make client to get ICC file from compositor. But seems Windows have implemented similar API, so I think wine still need it…