[PATCH] color-management: Add HDR-metadata support

Nautiyal, Ankit K ankit.k.nautiyal at intel.com
Mon Mar 18 15:54:37 UTC 2019

From: Ankit Nautiyal <ankit.k.nautiyal at intel.com>

This patch adds HDR-metadata support in the color-management-protocol.
It enables a client to:
- know if an output is HDR capable.
- set HDR-metadata values, received from an HDR content, for a surface.

The HDR-metadata values : MAX_CLL, MAX_FALL, MAX_LUMINANCE,
MIN LUMINANCE can be sent from the client to compositor, which can
inturn send these to kernel. Kernel can finally send these values in
AVI-INFOFRAMES to the HDR display to provide an idea of the brightness
of the content. The display can use this information to adapt itself
for a better viewing experience.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
 .../color-management-unstable-v1.xml               | 48 +++++++++++++++++++++-
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/unstable/color-management/color-management-unstable-v1.xml b/unstable/color-management/color-management-unstable-v1.xml
index 7b4d08e..58a41a1 100644
--- a/unstable/color-management/color-management-unstable-v1.xml
+++ b/unstable/color-management/color-management-unstable-v1.xml
@@ -119,7 +119,15 @@
       <arg name="id" type="new_id" interface="zwp_color_space_v1"/>
-    <!-- TODO: HDR capabilities event -->
+    <event name="hdr_capability">
+      <description summary="HDR Capability">
+	This event is sent after creating a zwp_color_management_output
+	(see zwp_color_manager.get_color_management_output) and tells about the
+	HDR capability of an output. A value of '1' indicates that the output
+	is HDR capable, and '0' indicates a non-HDR output.
+      </description>
+      <arg name="hdr_support" type="uint"/>
+    </event>
     <request name="destroy" type="destructor">
       <description summary="destroy the color management output">
@@ -171,7 +179,43 @@
       <arg name="render_intent" type="uint" enum="render_intent"/>
-    <!-- TODO: HDR metadata request -->
+    <request name="set_hdr_metadata">
+      <description summary="set the hdr metadata for the surface">
+	Set the HDR-metadata for the underlying surface. The HDR-metadata is
+	double buffered, and will be applied at the time wl_surface.commit of
+	the corresponding wl_surface is called.
+	The HDR-metadata constitutes of MAX-CLL, MAX-FALL, Max Luminance and
+	Min Luminance as defined by SMPTE ST.2086. The clients get these values
+	for an HDR video via ffmpeg for a video stream/file.
+	MAX-CLL (Maximum Content Light Level) tells the brightest pixel in the
+	entire stream/file in nits. MAX-FALL (Maximum Frame Average Light Level)
+	tells the highest frame average brightness in nits for a single frame.
+	Max and Min Luminance tells the max/min Luminance for the mastering
+	display. All except for Minimum Luminace, can be represented by integer,
+	as they take values of the order of hundreds of nits.
+	For Minimum Luminance, fixed type is used so that it can take smaller
+	decimal values, which can be converted to and from double.
+	For setting color-primaries as part of HDR-metadata, the client should
+	manufacture the icc profile and then use the zwp_color_manager interface
+	to get the color-space, (see zwp_color_manager.create_color_space).
+	The request set_color_space can then be used to set the color-space.
+	A client may request for setting the HDR-metadata for a surface, even if
+	there is no HDR-capable output, compositor should handle such cases.
+	The HDR-metadata should be initialized with '-1' for a surface,
+	signifying that the values are invalid. So, If a client does not set
+	hdr-metadata values for a surface, i.e. does not request
+	set_hdr_metadata default value of '-1' will be there, telling the
+	compositor that there is no HDR-metadata for that surface.
+      </description>
+      <arg name="max_cll" type="uint"/>
+      <arg name="max_fall" type="uint"/>
+      <arg name="max_luminance" type="uint"/>
+      <arg name="min_luminance" type="fixed"/>
+    </request>
     <event name="preferred_color_space">
       <description summary="preferred color space">

More information about the wayland-devel mailing list