[client] egl: fix messy white level default definition

This commit is contained in:
Geoffrey McRae
2026-07-18 16:39:55 +10:00
parent 85d0dbf83c
commit e3e0cfd43a
3 changed files with 4 additions and 4 deletions

View File

@@ -180,7 +180,7 @@ bool egl_cursorInit(EGL_Cursor ** cursor)
atomic_init(&(*cursor)->scale , 1.0f ); atomic_init(&(*cursor)->scale , 1.0f );
atomic_init(&(*cursor)->mapSDRtoPQ, false); atomic_init(&(*cursor)->mapSDRtoPQ, false);
atomic_init(&(*cursor)->sdrWhiteLevel, atomic_init(&(*cursor)->sdrWhiteLevel,
(float)KVMFR_SDR_WHITE_LEVEL_DEFAULT); KVMFR_SDR_WHITE_LEVEL_DEFAULT);
return true; return true;
} }
@@ -446,6 +446,6 @@ void egl_cursorSetHDRState(EGL_Cursor * cursor, bool hdrActive, bool hdrPQ,
float sdrWhiteLevel) float sdrWhiteLevel)
{ {
atomic_store(&cursor->sdrWhiteLevel, sdrWhiteLevel > 0.0f ? atomic_store(&cursor->sdrWhiteLevel, sdrWhiteLevel > 0.0f ?
sdrWhiteLevel : (float)KVMFR_SDR_WHITE_LEVEL_DEFAULT); sdrWhiteLevel : KVMFR_SDR_WHITE_LEVEL_DEFAULT);
atomic_store(&cursor->mapSDRtoPQ, hdrActive && hdrPQ); atomic_store(&cursor->mapSDRtoPQ, hdrActive && hdrPQ);
} }

View File

@@ -32,7 +32,7 @@
// Fallback used by producers that cannot report the source display's SDR // Fallback used by producers that cannot report the source display's SDR
// white level. IDD frames override this with IDDCX_METADATA2::SdrWhiteLevel. // white level. IDD frames override this with IDDCX_METADATA2::SdrWhiteLevel.
#define KVMFR_SDR_WHITE_LEVEL_DEFAULT 203u #define KVMFR_SDR_WHITE_LEVEL_DEFAULT 203
#define KVMFR_MAX_DAMAGE_RECTS 64 #define KVMFR_MAX_DAMAGE_RECTS 64

View File

@@ -883,7 +883,7 @@ static void lgFormatInit(LGPlugin * this, const KVMFRFrame * frame,
this->hdr = frame->flags & FRAME_FLAG_HDR; this->hdr = frame->flags & FRAME_FLAG_HDR;
this->hdrPQ = frame->flags & FRAME_FLAG_HDR_PQ; this->hdrPQ = frame->flags & FRAME_FLAG_HDR_PQ;
this->sdrWhiteLevel = frame->sdrWhiteLevel ? this->sdrWhiteLevel = frame->sdrWhiteLevel ?
(float)frame->sdrWhiteLevel : (float)KVMFR_SDR_WHITE_LEVEL_DEFAULT; frame->sdrWhiteLevel : KVMFR_SDR_WHITE_LEVEL_DEFAULT;
if (this->hdr && this->hdrPQ) if (this->hdr && this->hdrPQ)
lgComputeColorMatrix(this); lgComputeColorMatrix(this);