Re: HDR support in Wayland/Weston

2019-03-08 Thread Pekka Paalanen
On Fri, 8 Mar 2019 08:35:20 +1100
Graeme Gill  wrote:

> Michel Dänzer wrote:
> 
> > It sounds like KMS leases could be a pretty good fit for a calibration
> > application. It can lease each output individually from the Wayland
> > compositor and fully control it using KMS APIs, while the Wayland
> > compositor continues running normally on other outputs.  
> 
> There seems to be this idea that has got a hold amongst many commentators
> on this topic here, that somehow the display calibration and profiling
> application NEEDs raw and direct access to the a display to operate.

Hi Graeme,

that very idea stems from the early Wayland color management
discussions where it was strictly demanded that the application must be
able to completely bypass the compositor and own the hardware to do its
job correctly, because there is no trusting that a compositor could get
color management right. That is how it essentially was on X11 since the
X server did not second-guess or mangle application commands or images
and it did more or less expose the hardware of its time as is, letting
all the applications fight among each other for control.

I'm happy to see the original demand been mostly replaced, but
apparently it was so strongly underlined that understanding how much of
it is actually necessary is hard.

DRM leases are the modern idea for completely bypassing the compositor /
display server, and taking full control of the relevant part of the
display hardware yourself. DRM leases are driven by virtual reality
(VR) use cases for head-mounted displays (HMD), where the VR
application (or a VR compositor that is separate from the desktop
compositor due to hard realtime requirements) will be driving the HMD
directly by kernel UAPI (KMS) and it makes no sense to share the HMD
with anything else at the same time.

If we look at APIs, DRM KMS API is universal on Linux. DRM KMS is more
universal on Linux than Wayland, X11, or others, or any toolkit API,
because DRM KMS is *the* way to control displays at the lowest level
userspace can have access. KMS is hardware agnostic, but it does expose
hardware-specific features through a common API.

That said, personally I do think there is a good place for a Wayland
protocol extension designed for color
measurement/characterisation/calibration applications (is there a
shorter term I could use for all those apps?):

- It keeps the Wayland compositor in the loop, meaning that you are
  sure to reset the hardware state correctly for measurement, instead
  of the measurement application having to be updated to know how to
  reset everything the compositor might have been using, e.g. setting
  just one LUT vs. two LUTs and a matrix in the hardware.

- It allows a measurement app to cooperate with other apps without
  being stomped on or having to shut down everything else while it runs.

- It could allow uploading a new color profile to the compositor, if
  various compositor projects can agree on how to do that. Given that
  ICC spec exists, I guess there are good chances of succeeding. OTOH,
  desktop projects do tend to dislike any interfaces that attempt to
  bypass their own settings apps.

- It does offer some amount of API abstraction.

However, the extension will be specific to Wayland so you still have a
whole new platform to support in your color tool(kit)s.


Thanks,
pq


pgpb2pXeD4zVX.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Re: HDR support in Wayland/Weston

2019-03-08 Thread Michel Dänzer
On 2019-03-08 9:41 a.m., Graeme Gill wrote:
> Michel Dänzer wrote:
> 
>> It was never reliable for that. Other clients using any of those
>> mechanisms could always interfere, at least for the RandR compatibility
>> output.
> 
> I disagree. It was reliable in the sense that running the
> profile loader set it to a known state, irrespective
> of whatever other applications may have done via
> other API's.

You're assuming that the mechanism used by the profile loader directly
clobbers the HW LUT, making any adjustments made via other mechanisms
ineffective[0]. Even so, other clients can make adjustments using the
other mechanisms (or even the same one) at any time, which would again
clobber the HW LUT, interfering with the profile. Not reliable.

[0] This results in bug reports like
https://bugs.freedesktop.org/27222

> With the behavior changed to combine all the API settings, there is no
> simple way to set it to a known state.

You can set all other mechanisms to pass-through. If you want to be nice
to your users, maybe save their previous states and restore them
afterwards. Of course, if you want to prevent other clients from
interfering, you'd probably need to grab the server (which might result
in the desktop freezing with a compositing manager).


-- 
Earthling Michel Dänzer   |  https://www.amd.com
Libre software enthusiast | Mesa and X developer
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Re: HDR support in Wayland/Weston

2019-03-08 Thread Michel Dänzer
On 2019-03-07 10:07 p.m., Graeme Gill wrote:
> Michel Dänzer wrote:
> 
>> Yep. The alternative is that the different mechanisms clobber the
>> hardware LUT from each other, which sucks from a user POV.
> 
> Which user though ?
> 
> It certainly does the opposite of suck if you are a user
> who wants reliable color management, and so want a simple
> and direct mechanism to set the post frame buffer manipulation
> to a known state.
> 
> What does suck if you are a color critical user is that
> what used to be a reliable system (i.e. "run the profile
> loader") just became unreliable due to a system update.

It was never reliable for that. Other clients using any of those
mechanisms could always interfere, at least for the RandR compatibility
output.

> From this perspective I'm puzzled as to why such a change
> was implemented.

To make all these mechanisms work reliably and consistently at all times.


>> Welcome to
>> the wonderful world of "colour management" in X, please pick your
>> poison. I guess you can see why Wayland has a different design. :)
> 
> X11 has only got that way with such changes in behavior. It's
> been pretty reliable up to now, and at least is possible
> thanks to some foresight on the designers and implementer s part.

If you have specific suggestions, please post them to the xorg-devel
mailing lists or create a merge request at
https://gitlab.freedesktop.org/xorg/xserver/merge_requests .


-- 
Earthling Michel Dänzer   |  https://www.amd.com
Libre software enthusiast | Mesa and X developer
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel