[client] wayland: use the locally configured white level for SDR

This commit is contained in:
Geoffrey McRae
2026-07-20 00:26:37 +10:00
parent 23e394fd57
commit ceb5ac6f16
4 changed files with 31 additions and 35 deletions

View File

@@ -115,7 +115,6 @@ static bool waylandInit(const LG_DSInitParams params)
atomic_init(&wlWm.cmCanDoHDR, false);
atomic_init(&wlWm.hdrPQWhiteLevel, 203);
atomic_init(&wlWm.hdrScRGBWhiteLevel, 80);
atomic_init(&wlWm.hdrActivePQWhiteLevel, 203);
wlWm.display = wl_display_connect(NULL);
if (!wlWm.display)
@@ -236,12 +235,9 @@ static bool waylandGetProp(LG_DSProperty prop, void * ret)
if (prop == LG_DS_HDR_WHITE_LEVELS)
{
const bool activePQ = atomic_load(&wlWm.hdrActive) &&
atomic_load(&wlWm.hdrActivePQ);
*(LG_DSHDRWhiteLevels *)ret = (LG_DSHDRWhiteLevels)
{
.pq = activePQ ? atomic_load(&wlWm.hdrActivePQWhiteLevel) :
atomic_load(&wlWm.hdrPQWhiteLevel),
.pq = atomic_load(&wlWm.hdrPQWhiteLevel),
.scRGB = atomic_load(&wlWm.hdrScRGBWhiteLevel),
};
return true;
@@ -282,7 +278,7 @@ static bool waylandHDRCallback(const void * rendererFormat)
return waylandRequestHDR(format->hdrDisplayPrimary, format->hdrWhitePoint,
format->hdrMaxDisplayLuminance, format->hdrMinDisplayLuminance,
format->hdrMaxContentLightLevel, format->hdrMaxFrameAverageLightLevel,
format->hdrPQ, format->hdrMetadata);
format->sdrWhiteLevel, format->hdrPQ, format->hdrMetadata);
else
waylandRequestClearHDR();
return true;