[V7 31/45] drm/colorop: add BT2020/BT709 OETF and Inverse OETF

Pekka Paalanen pekka.paalanen at haloniitty.fi
Thu Jan 16 08:56:22 UTC 2025


On Thu, 19 Dec 2024 21:33:37 -0700
Alex Hung <alex.hung at amd.com> wrote:

> From: Harry Wentland <harry.wentland at amd.com>
> 
> The BT.709 and BT.2020 OETFs are the same, the only difference
> being that the BT.2020 variant is defined with more precision
> for 10 and 12-bit per color encodings.
> 
> Both are used as encoding functions for video content, and are
> therefore defined as OETF (opto-electronic transfer function)
> instead of as EOTF (electro-optical transfer function).
> 
> Signed-off-by: Alex Hung <alex.hung at amd.com>
> Signed-off-by: Harry Wentland <harry.wentland at amd.com>

Hi,

why would a display system ever use BT.2020 or BT.709 OETF or its
inverse?


Thanks,
pq


> ---
>  drivers/gpu/drm/drm_colorop.c |  2 ++
>  include/drm/drm_colorop.h     | 19 +++++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
> index f3391602a577..665b23900cc0 100644
> --- a/drivers/gpu/drm/drm_colorop.c
> +++ b/drivers/gpu/drm/drm_colorop.c
> @@ -70,6 +70,8 @@ static const struct drm_prop_enum_list drm_colorop_type_enum_list[] = {
>  static const char * const colorop_curve_1d_type_names[] = {
>  	[DRM_COLOROP_1D_CURVE_SRGB_EOTF] = "sRGB EOTF",
>  	[DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF] = "sRGB Inverse EOTF",
> +	[DRM_COLOROP_1D_CURVE_BT2020_INV_OETF] = "BT.2020 Inverse OETF",
> +	[DRM_COLOROP_1D_CURVE_BT2020_OETF] = "BT.2020 OETF",
>  	[DRM_COLOROP_1D_CURVE_PQ_125_EOTF] = "PQ 125 EOTF",
>  	[DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF] = "PQ 125 Inverse EOTF",
>  };
> diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h
> index 4084a7438032..83a6bd64d48a 100644
> --- a/include/drm/drm_colorop.h
> +++ b/include/drm/drm_colorop.h
> @@ -55,6 +55,25 @@ enum drm_colorop_curve_1d_type {
>  	 */
>  	DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF,
>  
> +	/**
> +	 * @DRM_COLOROP_1D_CURVE_BT2020_INV_OETF:
> +	 *
> +	 * The inverse of &DRM_COLOROP_1D_CURVE_BT2020_OETF
> +	 */
> +	DRM_COLOROP_1D_CURVE_BT2020_INV_OETF,
> +
> +	/**
> +	 * @DRM_COLOROP_1D_CURVE_BT2020_OETF:
> +	 *
> +	 * The BT.2020/BT.709 transfer function. The BT.709 and BT.2020
> +	 * transfer functions are the same, the only difference is that
> +	 * BT.2020 is defined with more precision for 10 and 12-bit
> +	 * encodings.
> +	 *
> +	 *
> +	 */
> +	DRM_COLOROP_1D_CURVE_BT2020_OETF,
> +
>  	/**
>  	 * @DRM_COLOROP_1D_CURVE_PQ_125_EOTF:
>  	 *
> -- 
> 2.43.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20250116/811b00a2/attachment.sig>


More information about the wayland-devel mailing list