Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/colorop: Add PQ 125 EOTF and its inverse

The PQ function defines a mapping of code values to nits (cd/m^2).
The max code value maps to 10,000 nits.

Windows DWM's canonical composition color space (CCCS) defaults
to composing SDR contents to 80 nits and uses a float value of
1.0 to represent this. For this reason AMD HW hard-codes a PQ
function that is scaled by 125, yielding 80 nit PQ values for
1.0 and 10,000 nits at 125.0.

This patch introduces this scaled PQ EOTF and its inverse as
1D curve types.

Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patch.msgid.link/20251115000237.3561250-32-alex.hung@amd.com

authored by

Harry Wentland and committed by
Simon Ser
1b754474 52da8325

+26
+2
drivers/gpu/drm/drm_colorop.c
··· 70 70 static const char * const colorop_curve_1d_type_names[] = { 71 71 [DRM_COLOROP_1D_CURVE_SRGB_EOTF] = "sRGB EOTF", 72 72 [DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF] = "sRGB Inverse EOTF", 73 + [DRM_COLOROP_1D_CURVE_PQ_125_EOTF] = "PQ 125 EOTF", 74 + [DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF] = "PQ 125 Inverse EOTF", 73 75 }; 74 76 75 77 /* Init Helpers */
+24
include/drm/drm_colorop.h
··· 59 59 DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF, 60 60 61 61 /** 62 + * @DRM_COLOROP_1D_CURVE_PQ_125_EOTF: 63 + * 64 + * enum string "PQ 125 EOTF" 65 + * 66 + * The PQ transfer function, scaled by 125.0f, so that 10,000 67 + * nits correspond to 125.0f. 68 + * 69 + * Transfer characteristics of the PQ function as defined by 70 + * SMPTE ST 2084 (2014) for 10-, 12-, 14-, and 16-bit systems 71 + * and Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system, 72 + * represented by H.273 TransferCharacteristics code point 16. 73 + */ 74 + DRM_COLOROP_1D_CURVE_PQ_125_EOTF, 75 + 76 + /** 77 + * @DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF: 78 + * 79 + * enum string "PQ 125 Inverse EOTF" 80 + * 81 + * The inverse of DRM_COLOROP_1D_CURVE_PQ_125_EOTF. 82 + */ 83 + DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF, 84 + 85 + /** 62 86 * @DRM_COLOROP_1D_CURVE_COUNT: 63 87 * 64 88 * enum value denoting the size of the enum