[idd/client] apply the Windows display color transform

Honor the IddCx 3x4 XYZ matrix and post-transfer LUT in the IDD
conversion pipeline. Carry transform changes to the client so EGL applies
the same calibration to hardware cursors, and invalidate the full frame
whenever calibration changes.
This commit is contained in:
Geoffrey McRae
2026-07-19 03:11:42 +10:00
parent ad5d7753e8
commit 26ca90893a
17 changed files with 766 additions and 48 deletions

View File

@@ -28,7 +28,7 @@
#include "types.h"
#define KVMFR_MAGIC "KVMFR---"
#define KVMFR_VERSION 21
#define KVMFR_VERSION 22
// Fallback used by producers that cannot report the source display's SDR
// white level. IDD frames override this with IDDCX_METADATA2::SdrWhiteLevel.
@@ -51,9 +51,10 @@
enum
{
CURSOR_FLAG_POSITION = 0x1,
CURSOR_FLAG_VISIBLE = 0x2,
CURSOR_FLAG_SHAPE = 0x4
CURSOR_FLAG_POSITION = 0x1,
CURSOR_FLAG_VISIBLE = 0x2,
CURSOR_FLAG_SHAPE = 0x4,
CURSOR_FLAG_COLOR_TRANSFORM = 0x8
};
typedef uint32_t KVMFRCursorFlags;
@@ -137,6 +138,28 @@ typedef struct KVMFRCursor
}
KVMFRCursor;
enum
{
KVMFR_COLOR_TRANSFORM_MATRIX = 0x1,
KVMFR_COLOR_TRANSFORM_LUT = 0x2,
};
typedef uint32_t KVMFRColorTransformFlags;
// Optional payload appended to KVMFRCursor when
// CURSOR_FLAG_COLOR_TRANSFORM is present. The matrix is an XYZ-to-XYZ
// adjustment; the LUT is applied after encoding to the active wire transfer
// function. Four LUT components keep the payload directly uploadable as an
// RGBA32F texture, with alpha reserved and set to 1.0.
typedef struct KVMFRColorTransform
{
KVMFRColorTransformFlags flags;
float matrix[3][4];
float scalar;
float lut[4096][4];
}
KVMFRColorTransform;
enum
{
FRAME_FLAG_BLOCK_SCREENSAVER = 0x1 ,