<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 2/14/2019 1:27 PM, Sebastian Wick
      wrote:<br>
    </div>
    <blockquote
      cite="mid:3c0dd6c154fa2db220830e1c8f936376@sebastianwick.net"
      type="cite">On 2019-02-14 08:13, Nautiyal, Ankit K via
      wayland-devel wrote:
      <br>
      <blockquote type="cite">Hi Sebastian,
        <br>
        <br>
        I am trying to extend Ole's color management protocol [1] to
        enable a
        <br>
        client to pass HDR meta data.
        <br>
        Added the modified protocol as weston protocol for the time
        being. [2]
        <br>
      </blockquote>
      <br>
      Thanks. That's useful.
      <br>
      <br>
      <blockquote type="cite">
        <br>
        You have mention that the proposed protocol, ignores the HDR
        <br>
        calibration/profiling,  so do you suggest there should
        <br>
        be another protocol for that altogether or is there a
        possibility to
        <br>
        extend this for handling HDR metadata?
        <br>
      </blockquote>
      <br>
      I absolutely think that this can be extended for handling HDR.
      <br>
      <br>
      <blockquote type="cite">
        <br>
        [1]
        <br>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/archives/wayland-devel/2017-January/032770.html">https://lists.freedesktop.org/archives/wayland-devel/2017-January/032770.html</a>
        <br>
        [2]
        <br>
<a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/aknautiyal/weston/commit/9d08cc22d6ba2b0c48ac255abc86ba5e217a507c">https://gitlab.freedesktop.org/aknautiyal/weston/commit/9d08cc22d6ba2b0c48ac255abc86ba5e217a507c</a>
        <br>
        <br>
        Also, there are a few queries to understand the flow, please
        find
        <br>
        below inline:
        <br>
        On 2/14/2019 8:16 AM, Sebastian Wick wrote:
        <br>
        <br>
        <blockquote type="cite">This protocol allows clients to attach a
          color space and rendering
          <br>
          intent to a wl_surface. It further allows the client to be
          informed
          <br>
          which color spaces a wl_surface was converted to on the last
          <br>
          presented.
          <br>
          <br>
          Signed-off-by: Sebastian Wick
          <a class="moz-txt-link-rfc2396E" href="mailto:sebastian@sebastianwick.net"><sebastian@sebastianwick.net></a>
          <br>
          ---
          <br>
          Makefile.am                                   |   1 +
          <br>
          unstable/color-management/README              |   4 +
          <br>
          .../color-management-unstable-v1.xml          | 183
          <br>
          ++++++++++++++++++
          <br>
          3 files changed, 188 insertions(+)
          <br>
          create mode 100644 unstable/color-management/README
          <br>
          create mode 100644
          <br>
          unstable/color-management/color-management-unstable-v1.xml
          <br>
          <br>
          diff --git a/Makefile.am b/Makefile.am
          <br>
          index 345ae6a..80abc1d 100644
          <br>
          --- a/Makefile.am
          <br>
          +++ b/Makefile.am
          <br>
          @@ -23,6 +23,7 @@ unstable_protocols =
          <br>
          \
          <br>
          unstable/xdg-decoration/xdg-decoration-unstable-v1.xml    \
          <br>
          <br>
          <br>
        </blockquote>
unstable/linux-explicit-synchronization/linux-explicit-synchronization-unstable-v1.xml
        <br>
        <blockquote type="cite">\
          <br>
          unstable/primary-selection/primary-selection-unstable-v1.xml
          <br>
          \
          <br>
          +   
          unstable/color-management/color-management-unstable-v1.xml
          <br>
          \
          <br>
          $(NULL)
          <br>
          <br>
          stable_protocols =                                \
          <br>
          diff --git a/unstable/color-management/README
          <br>
          b/unstable/color-management/README
          <br>
          new file mode 100644
          <br>
          index 0000000..140f1e9
          <br>
          --- /dev/null
          <br>
          +++ b/unstable/color-management/README
          <br>
          @@ -0,0 +1,4 @@
          <br>
          +Color management protocol
          <br>
          +
          <br>
          +Maintainers:
          <br>
          +Sebastian Wick <a class="moz-txt-link-rfc2396E" href="mailto:sebastian@sebastianwick.net"><sebastian@sebastianwick.net></a>
          <br>
          diff --git
          <br>
          a/unstable/color-management/color-management-unstable-v1.xml
          <br>
          b/unstable/color-management/color-management-unstable-v1.xml
          <br>
          new file mode 100644
          <br>
          index 0000000..1615fe6
          <br>
          --- /dev/null
          <br>
          +++
          b/unstable/color-management/color-management-unstable-v1.xml
          <br>
          @@ -0,0 +1,183 @@
          <br>
          +<?xml version="1.0" encoding="UTF-8"?>
          <br>
          +<protocol name="color_management_unstable_v1">
          <br>
          +
          <br>
          +  <copyright>
          <br>
          +    Copyright © 2019 Sebastian Wick
          <br>
          +    Copyright © 2019 Erwin Burema
          <br>
          +
          <br>
          +    Permission is hereby granted, free of charge, to any
          person
          <br>
          obtaining a
          <br>
          +    copy of this software and associated documentation files
          (the
          <br>
          "Software"),
          <br>
          +    to deal in the Software without restriction, including
          without
          <br>
          limitation
          <br>
          +    the rights to use, copy, modify, merge, publish,
          distribute,
          <br>
          sublicense,
          <br>
          +    and/or sell copies of the Software, and to permit persons
          to
          <br>
          whom the
          <br>
          +    Software is furnished to do so, subject to the following
          <br>
          conditions:
          <br>
          +
          <br>
          +    The above copyright notice and this permission notice
          <br>
          (including the next
          <br>
          +    paragraph) shall be included in all copies or substantial
          <br>
          portions of the
          <br>
          +    Software.
          <br>
          +
          <br>
          +    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
          KIND,
          <br>
          EXPRESS OR
          <br>
          +    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
          <br>
          MERCHANTABILITY,
          <br>
          +    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN
          NO
          <br>
          EVENT SHALL
          <br>
          +    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
          <br>
          DAMAGES OR OTHER
          <br>
          +    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
          OTHERWISE,
          <br>
          ARISING
          <br>
          +    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
          USE OR
          <br>
          OTHER
          <br>
          +    DEALINGS IN THE SOFTWARE.
          <br>
          +  </copyright>
          <br>
          +
          <br>
          +  <description summary="color management protocol">
          <br>
          +    This protocol provides the ability to specify the color
          space
          <br>
          +    of a wl_surface. If further enumerates the color spaces
          <br>
          currently
          <br>
          +    in the system and allows to query feedback about which
          color
          <br>
          spaces
          <br>
          +    a wl_surface was converted to on the last present.
          <br>
          +    The idea behind the feedback system is to allow the
          client to
          <br>
          do color
          <br>
          +    conversion to a color space which will likely be used to
          show
          <br>
          the surface
          <br>
          +    which allows the compositor to skip the color conversion
          step.
          <br>
          +  </description>
          <br>
          +
          <br>
          +  <interface name="zwp_color_manager_v1" version="1">
          <br>
          +    <description summary="color manager">
          <br>
          +      The color manager is a singleton global object that
          provides
          <br>
          access
          <br>
          +      to outputs' color spaces, let's you create new color
          spaces
          <br>
          and attach
          <br>
          +      a color space to surfaces.
          <br>
          +    </description>
          <br>
          +
          <br>
          +    <enum name="render_intent">
          <br>
          +      <description summary="render intent">
          <br>
          +        render intents
          <br>
          +      </description>
          <br>
          +      <entry name="absolute" value="1"/>
          <br>
          +      <entry name="relative" value="2"/>
          <br>
          +      <entry name="perceptual" value="3"/>
          <br>
          +      <entry name="saturation" value="4" />
          <br>
          +    </enum>
          <br>
          +
          <br>
          +    <enum name="well_known_color_space">
          <br>
          +      <description summary="well-known color spaces">
          <br>
          +        Well-known color spaces
          <br>
          +      </description>
          <br>
          +      <entry name="none" value="0" summary="no known color
          space"
          <br>
          />
          <br>
          +      <entry name="sRGB" value="1" summary="sRGB color
          space" />
          <br>
          +      <entry name="adobeRGB" value="2" summary="Adobe RGB"
          />
          <br>
          +      <entry name="DCI-3P" value="3" summary="DCI-3P"
          />
          <br>
          +      <entry name="rec2020" value="4" summary="rec2020"
          />
          <br>
          +      <entry name="rec2020-pq" value="5" summary="rec2020
          with pq
          <br>
          curve (HDR)" />
          <br>
          +      <entry name="rec2020-hlg" value="6" summary="rec2020
          with HLG
          <br>
          curve (HDR)" />
          <br>
          +    </enum>
          <br>
          +
          <br>
          +    <enum name="error">
          <br>
          +      <description summary="fatal color manager
          errors">
          <br>
          +        These fatal protocol errors may be emitted in
          response to
          <br>
          +        illegal color management requests.
          <br>
          +      </description>
          <br>
          +      <entry name="invalid_icc_profile" value="0"
          summary="invalid
          <br>
          ICC profile"/>
          <br>
          +    </enum>
          <br>
          +
          <br>
          +    <request name="set_color_space">
          <br>
          +      <description summary="set the color space of a
          surface">
          <br>
          +        Set the color space of a surface. The color space is
          double
          <br>
          buffered,
          <br>
          +        and will be applied at the time wl_surface.commit of
          the
          <br>
          corresponding
          <br>
          +        wl_surface is called.
          <br>
          +
          <br>
          +        The render intent gives the compositor a hint what to
          <br>
          optimize for
          <br>
          +        in color space conversions.
          <br>
          +
          <br>
          +        If a surface has no color space set, sRGB and an
          arbitrary
          <br>
          render
          <br>
          +        intent will be assumed.
          <br>
          +      </description>
          <br>
          +      <arg name="surface" type="object"
          interface="wl_surface"/>
          <br>
          +      <arg name="color_space" type="object"
          <br>
          interface="zwp_color_space_v1"/>
          <br>
          +      <arg name="render_intent" type="uint"
          enum="render_intent"/>
          <br>
          +    </request>
          <br>
          +
          <br>
          +    <request name="color_space_feedback">
          <br>
          +      <description summary="color space feedback">
          <br>
          +        Request color space feedback for the current content
          <br>
          submission
          <br>
          +        on the given surface. This creates a new
          <br>
          color_space_feedback
          <br>
          +        object, which will deliver the feedback information
          once.
          <br>
          If
          <br>
          +        multiple color_space_feedback objects are created for
          the
          <br>
          same
          <br>
          +        submission, they will all deliver the same
          information.
          <br>
          +
          <br>
          +        For details on what information is returned, see the
          <br>
          +        color_space_feedback interface.
          <br>
          +      </description>
          <br>
          +      <arg name="surface" type="object"
          interface="wl_surface"/>
          <br>
          +      <arg name="feedback" type="new_id"
          <br>
          interface="zwp_color_space_feedback_v1"/>
          <br>
          +    </request>
          <br>
          +
          <br>
          +    <request name="color_space_from_icc">
          <br>
          +      <description summary="create a color space from an
          ICC
          <br>
          profile">
          <br>
          +        Create a color space from an ICC profile. Only three
          <br>
          channel
          <br>
          +        profiles are allowed.
          <br>
          +      </description>
          <br>
          +      <arg name="color_space" type="new_id"
          <br>
          interface="zwp_color_space_v1"/>
          <br>
          +      <arg name="icc" type="fd"/>
          <br>
          +    </request>
          <br>
          +
          <br>
        </blockquote>
        <br>
        If I understand it correctly,
        <br>
        the client first sends a request for getting color-space for an
        icc
        <br>
        file, receives the color_space interface.
        <br>
        If we can add the surface in this requests, it can be tied to
        the
        <br>
        color-space interface, and later set color_space,
        <br>
        without the surface.
        <br>
      </blockquote>
      <br>
      There is two ways to get a color_space object. The first one is to
      listen for
      <br>
      color_space_added events and the other, like you noted, is to call
      <br>
      color_space_from_icc.
      <br>
      However, I don't see why a color space should should be tied to a
      wl_surface
      <br>
      from the beginning. Binding the color space to a surface with
      set_color_space
      <br>
      allows us to use the color spaces coming from the compositor via
      the
      <br>
      color_space_added event.
      <br>
      <br>
      Can you explain why you want to do this differently?
      <br>
    </blockquote>
    <br>
    <font size="-1">Sorry, I missed the color_space_added event.<br>
      I got it now. So as soon as the client starts, and binding of the
      client object to the<br>
      server, it receives a series of events, notifying it with the
      well-known colorspaces.<br>
      Clients stores each of the color_space interfaces and choose it
      deems best.<br>
      <br>
      Thanks for clarifying, this answers my other question as well,
      regarding well-known color-spaces.<br>
      <br>
      I still wonder about the 'information' event sent by the
      color_space_interface.<br>
      When will this event be sent. I think this should be in response
      to a client request for the <br>
      color-space information via the color_space_interface.<br>
      Also, such an event will be sent for which all outputs?</font><br>
    <br>
    <blockquote
      cite="mid:3c0dd6c154fa2db220830e1c8f936376@sebastianwick.net"
      type="cite">
      <blockquote type="cite">
        <br>
        You have declared some of the color-space as well known, do you
        think
        <br>
        it will be useful to also let the
        <br>
        client get the color_space interface, based on the well-known
        <br>
        color-space.?
        <br>
        Server on the other hand can have already built objects from the
        <br>
        standard icc files, the interfaces of
        <br>
        which can be passed to the client.
        <br>
      </blockquote>
      <br>
      When the compositor loaded an icc profile for e.g. a display it
      should emit a
      <br>
      color_space_added event which then, if the color space is
      "well-known" (other
      <br>
      names were suggested) the zwp_color_space_v1.information event
      should say
      <br>
      that.
      <br>
      <br>
      So I think what you suggest is already possible with this
      protocol.
      <br>
      <br>
      <blockquote type="cite">
        <br>
        <blockquote type="cite">+    <event
          name="color_space_added">
          <br>
          +      <description summary="color space added">
          <br>
          +        Send after binding or when a new color space is added
          to
          <br>
          the system.
          <br>
          +      </description>
          <br>
          +      <arg name="color_space" type="new_id"
          <br>
          interface="zwp_color_space_v1"/>
          <br>
          +    </event>
          <br>
          +  </interface>
          <br>
          +
          <br>
          +  <interface name="zwp_color_space_v1" version="1">
          <br>
          +    <description summary="a color space">
          <br>
          +      A color space can be attached to a wl_surface and sends
          <br>
          +      information like the ICC profile to let the client
          perform
          <br>
          color
          <br>
          +      correction.
          <br>
          +    </description>
          <br>
          +
          <br>
          +    <event name="information">
          <br>
          +      <description summary="color space information">
          <br>
          +        Information describing the color space.
          <br>
          +
          <br>
          +        The icc argument contains a fd to the corresponding
          ICC
          <br>
          profile.
          <br>
          +        well-known can be used to easily identify a
          color-space.
          <br>
          +
          <br>
          +        A color space can be associated with a wl_output.
          <br>
          +      </description>
          <br>
          +      <arg name="icc" type="fd"/>
          <br>
          +      <arg name="well-known" type="uint"
          <br>
          enum="well_known_color_space"/>
          <br>
          +      <arg name="output" type="object"
          interface="wl_output"
          <br>
          allow-null="true"/>
          <br>
          +    </event>
          <br>
          +
          <br>
        </blockquote>
        <br>
        When will this event be generated, should there be a request
        from a
        <br>
        client via the color_space interface
        <br>
        for the information? Will events be sent for each output, the
        surface
        <br>
        is displayed on?
        <br>
        <br>
        <blockquote type="cite">+    <event name="removed">
          <br>
          +      <description summary="color space removed">
          <br>
          +        This event is sent when the color space is removed
          from the
          <br>
          system.
          <br>
          +        When this event is received, the client must destroy
          the
          <br>
          object.
          <br>
          +      </description>
          <br>
          +    </event>
          <br>
          +
          <br>
          +    <request name="destroy" type="destructor">
          <br>
          +      <description summary="destroy the color space
          object">
          <br>
          +          Destroy the color_space object.
          <br>
          +      </description>
          <br>
          +    </request>
          <br>
          +  </interface>
          <br>
          +
          <br>
          +  <interface name="zwp_color_space_feedback_v1"
          version="1">
          <br>
          +    <description summary="color space feedback">
          <br>
          +      The surface content was converted to a number of color
          spaces
          <br>
          +      on the last content update. They get listed in
          decreasing
          <br>
          order
          <br>
          +      of importance by the converted event.
          <br>
          +      Once a color_space_feedback object has delivered a done
          <br>
          +      event it is automatically destroyed.
          <br>
          +    </description>
          <br>
          +
          <br>
          +    <event name="converted">
          <br>
          +      <description summary="color space conversion">
          <br>
          +        The surface was converted to a color space.
          <br>
          +      </description>
          <br>
          +      <arg name="color_space" type="object"
          <br>
          interface="zwp_color_space_v1"/>
          <br>
          +    </event>
          <br>
          +
          <br>
        </blockquote>
        <br>
        So a client with a surface, will receive a series of these
        events for
        <br>
        its surface, whenever the
        <br>
        color space conversion takes place for that surface?
        <br>
        Why do we need this interface, can the color_manager be used to
        send
        <br>
        these events?
        <br>
      </blockquote>
      <br>
      The client will receive the events on the next present when it
      created the
      <br>
      zwp_color_space_feedback_v1 object via
      <br>
      zwp_color_manager_v1.color_space_feedback.
      <br>
      This is strictly not needed but allows the client to choose a
      color space
      <br>
      to render to which will likely be used to display the surface on
      the next
      <br>
      present which in turn means that the compositor can skip color
      conversion.
      <br>
      <br>
      I hope this answers all your questions. Feel free to keep
      questioning me.
      <br>
      <br>
      I'll try to come up with a modification of this protocol that can
      handle HDR
      <br>
      based on your changes.
      <br>
    </blockquote>
    <br>
    <font size="-1">Thanks, that will be great.<br>
      Should you have anything to discuss in this regard, please let me
      know through mail, or IRC: aknautiy<br>
      <br>
      Regards,<br>
      Ankit</font><br>
    <br>
    <blockquote
      cite="mid:3c0dd6c154fa2db220830e1c8f936376@sebastianwick.net"
      type="cite">
      <br>
      <blockquote type="cite">
        <br>
        Thanks & Regards,
        <br>
        Ankit
        <br>
        <br>
        <blockquote type="cite">+    <event name="done">
          <br>
          +      <description summary="done listing color space
          conversions">
          <br>
          +        All color space conversion have been listed.
          <br>
          +      </description>
          <br>
          +    </event>
          <br>
          +  </interface>
          <br>
          +
          <br>
          +</protocol>
          <br>
        </blockquote>
        _______________________________________________
        <br>
        wayland-devel mailing list
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a>
        <br>
        <a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel">https://lists.freedesktop.org/mailman/listinfo/wayland-devel</a>
        <br>
      </blockquote>
      _______________________________________________
      <br>
      wayland-devel mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel">https://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
    </blockquote>
    <br>
  </body>
</html>