diff mbox series

[3/3] drm: add enum drm_hdr_metadata_eotf

Message ID 20230428100115.9802-3-contact@emersion.fr (mailing list archive)
State New, archived
Headers show
Series [1/3] drm: fix code style for embedded structs in hdr_metadata_infoframe | expand

Commit Message

Simon Ser April 28, 2023, 10:01 a.m. UTC
Avoids hardcoding magic numbers in user-space, and makes the docs
clearer.

Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sebastian Wick <sebastian.wick@redhat.com>
Cc: Joshua Ashton <joshua@froggi.es>
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
---
 include/uapi/drm/drm_mode.h | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index c0c40dc9e2f1..eb2a38c73ae0 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -859,6 +859,31 @@  enum drm_hdr_metadata_type {
 	DRM_HDR_STATIC_METADATA_TYPE1 = 0,
 };
 
+/**
+ * enum drm_hdr_metadata_eotf - Electro-Optical Transfer Function.
+ */
+enum drm_hdr_metadata_eotf {
+	/**
+	 * @DRM_HDR_METADATA_EOTF_TRADITIONAL_GAMMA_SDR: traditional gamma, SDR
+	 * luminance range.
+	 */
+	DRM_HDR_METADATA_EOTF_TRADITIONAL_GAMMA_SDR = 0,
+	/**
+	 * @DRM_HDR_METADATA_EOTF_TRADITIONAL_GAMMA_HDR: traditional gamma, HDR
+	 * luminance range.
+	 */
+	DRM_HDR_METADATA_EOTF_TRADITIONAL_GAMMA_HDR = 1,
+	/**
+	 * @DRM_HDR_METADATA_EOTF_SMPTE_ST_2084: SMPTE ST 2084.
+	 */
+	DRM_HDR_METADATA_EOTF_SMPTE_ST_2084 = 2,
+	/**
+	 * @DRM_HDR_METADATA_EOTF_HLG_BT2100: Hybrid Log-Gamma (HLG) based on
+	 * ITU-R BT.2100-0.
+	 */
+	DRM_HDR_METADATA_EOTF_HLG_BT2100 = 3,
+};
+
 /**
  * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.
  *
@@ -871,7 +896,7 @@  enum drm_hdr_metadata_type {
 struct hdr_metadata_infoframe {
 	/**
 	 * @eotf: Electro-Optical Transfer Function (EOTF)
-	 * used in the stream.
+	 * used in the stream. See enum drm_hdr_metadata_eotf.
 	 */
 	__u8 eotf;
 	/**