[RFC wayland-protocols v2 1/1] Add the color-management protocol

Kai-Uwe ku.b-list at gmx.de
Thu Feb 28 08:12:57 UTC 2019


Am 27.02.19 um 14:17 schrieb Pekka Paalanen:
> On Tue, 26 Feb 2019 18:56:06 +0100
> Kai-Uwe <ku.b-list at gmx.de> wrote:
>
>> Am 26.02.19 um 16:48 schrieb Pekka Paalanen:
>>> On Sun, 22 Jan 2017 13:31:35 +0100
>>> Niels Ole Salscheider <niels_ole at salscheider-online.de> wrote:
>>>  
>>>> Signed-off-by: Niels Ole Salscheider <niels_ole at salscheider-online.de>  
>>>>
>>>> +    <request name="set_device_link_profile">
>>>> +      <description summary="set a device link profile for a wl_surface and wl_output">
>>>> +        With this request, a device link profile can be attached to a
>>>> +        wl_surface. For each output on which the surface is visible, the
>>>> +        compositor will check if there is a device link profile. If there is one
>>>> +        it will be used to directly convert the surface to the output color
>>>> +        space. Blending of this surface (if necessary) will then be performed in
>>>> +        the output color space and after the normal blending operations.  
>>> Are those blending rules actually implementable?
>>>
>>> It is not generally possible to blend some surfaces into a temporary
>>> buffer, convert that to the next color space, and then blend some more,
>>> because the necessary order of blending operations depends on the
>>> z-order of the surfaces.
>>>
>>> What implications does this have on the CRTC color processing pipeline?
>>>
>>> If a CRTC color processing pipeline, that is, the transformation from
>>> framebuffer values to on-the-wire values for a monitor, is already set
>>> up by the compositor's preference, what would a device link profile
>>> look like? Does it produce on-the-wire or blending space?
>>>
>>> If the transformation defined by the device link profile produced
>>> values for the monitor wire, then the compositor will have to undo the
>>> CRTC pipeline transformation during composition for this surface, or it
>>> needs to reset CRTC pipeline setup to identity and apply it manually
>>> for all other surfaces.
>>>
>>> What is the use for a device link profile?  
>> A device link profile is useful to describe a transform from a buffer to
>> a match one specific output. Device links can give a very fine grained
>> control to applications to decide what they want with their colors. This
>> is useful in case a application want to circumvent the default gamut
>> mapping optimise for each output connected to a computer or add color
>> effects like proofing. The intelligence is inside the device link
>> profile and the compositor applies that as a dump rule.
> Hi Kai-Uwe,
>
> right, thank you. I did get the feeling right on what it is supposed to
> do, but I have hard time imagining how to implement that in a compositor
> that also needs to cater for other windows on the same output and blend
> them all together correctly.
>
> Even without blending, it means that the CRTC color manipulation
> features cannot really be used at all, because there are two
> conflicting transformations to apply: from compositor internal
> (blending) space to the output space, and from the application content
> space through the device link profile to the output space. The only
> way that could be realized without any additional reverse
> transformations is that the CRTC is set as an identity pass-through,
> and both kinds of transformations are done in the composite rendering
> with OpenGL or Vulkan.
What are CRTC color manipulation features in wayland? blending?
> If we want device link profiles in the protocol, then I think that is
> the cost we have to pay. But that is just about performance, while to
> me it seems like correct blending would be impossible to achieve if
> there was another translucent window on top of the window using a
> device link profile. Or even worse, a stack like this:
>
> window B (color profile)
> window A (device link profile)
> wallpaper (color profile)

Thanks for the simplification.

> If both windows have translucency somewhere, they must be blended in
> that order. The blending of window A cannot be postponed after the
> others.

Remembers me on the discussions we had with the Cairo people years ago.

> I guess that implies that if even one surface on an output uses a
> device link profile, then all blending must be done in the output color
> space instead of an intermediate blending space. Is that an acceptable
> trade-off?

It will make "high quality" apps look like blending fun stoppers. Not so
nice. In contrast, the conversion back from output space to blending
space then blending and then conversion to output will maintain the
blending space experience at some performance cost and break the
original device link intent. Would that fit a trade-off for you? (So app
client developers should never use translucent portions. However the
toolkit or compositor might enforce this, e.g. for window decoration,
that outside translucency would break the app intention.)

> Does that even make any difference if the output space was linear at
> blending step, and gamma was applied after that?

Interesting. There came the argument that the complete graphics pipeline
should be used for measuring the device for profile generation. So, if
linear (blending) space is always shown to applications and measurement
tools, then that should be profiled and fine. Anyway, a comment from
Graeme Gill would be welcome, on how to profile in linear space? As a
side effect, wayland/OpenGL can do the PQ/HLG decoding afterwards,
without the ICC profiling tool have to worry about. I guess all the
dynamic HDR features will more or less destroy the static connection of
input values to display values. The problem for traditional color
management is that linearisation, or as others spell it, gamma transfer
will be a very late step inside the monitor to do correctly. So one
arising question is, how will the 1D graphic card LUT (VCGT) be
implemented? With VCGT properly supported, the output profile could
still work on sufficiently well prepared device behaviour.

Here a possible process chain:

* app buffer (device link for proofing or source profile) ->[ICC
conversion in compositor]->

* blending space (linear) ->[gamma 2.2]->

* calibration protocol ->[1D calibration (VCGT)]->

* [encoding for on-the-wire values PQ/...]->

* transfer to device

The calibration protocol is there for completeness.

thanks,
Kai-Uwe



More information about the wayland-devel mailing list