[client] egl: make native HDR encoding-safe

Request true floating-point EGL configs for scRGB and expose the native
encodings supported by the selected surface. Fall back to software HDR
mapping when the surface cannot represent the incoming wire format.

Resample PQ in linear light, keep SDR-only effects out of native PQ
chains, and consume the cursor-specific white level without changing
binary monochrome cursor mask operations.
This commit is contained in:
Geoffrey McRae
2026-07-19 04:42:30 +10:00
parent 20225f05d1
commit 70b795c5ba
10 changed files with 160 additions and 42 deletions

View File

@@ -501,7 +501,12 @@ struct CursorState egl_cursorRender(EGL_Cursor * cursor,
void egl_cursorSetHDRState(EGL_Cursor * cursor, bool hdrActive, bool hdrPQ,
float sdrWhiteLevel)
{
atomic_store(&cursor->sdrWhiteLevel, sdrWhiteLevel > 0.0f ?
sdrWhiteLevel : KVMFR_SDR_WHITE_LEVEL_DEFAULT);
egl_cursorSetSDRWhiteLevel(cursor, sdrWhiteLevel);
atomic_store(&cursor->wireTransfer, !hdrActive ? 0 : (hdrPQ ? 2 : 1));
}
void egl_cursorSetSDRWhiteLevel(EGL_Cursor * cursor, float sdrWhiteLevel)
{
atomic_store(&cursor->sdrWhiteLevel, sdrWhiteLevel > 0.0f ?
sdrWhiteLevel : KVMFR_SDR_WHITE_LEVEL_DEFAULT);
}