From: Pekka Paalanen <ppaalanen@gmail.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "Sebastian Wick" <sebastian.wick@redhat.com>,
"Shashank Sharma" <shashank.sharma@amd.com>,
"Xaver Hugl" <xaver.hugl@gmail.com>,
dri-devel@lists.freedesktop.org,
wayland-devel@lists.freedesktop.org,
"Melissa Wen" <mwen@igalia.com>,
"Jonas Ådahl" <jadahl@redhat.com>,
"Uma Shankar" <uma.shankar@intel.com>,
"Michel Dänzer" <mdaenzer@redhat.com>,
"Victoria Brekenfeld" <victoria@system76.com>,
"Aleix Pol" <aleixpol@kde.org>,
"Naseer Ahmed" <quic_naseer@quicinc.com>,
"Christopher Braga" <quic_cbraga@quicinc.com>,
"Joshua Ashton" <joshua@froggi.es>
Subject: Re: [RFC PATCH 01/10] drm/doc/rfc: Describe why prescriptive color pipeline is needed
Date: Mon, 13 Nov 2023 12:01:34 +0200 [thread overview]
Message-ID: <20231113120134.5791b90d@eldfell> (raw)
In-Reply-To: <76e1744e-28bb-40d3-b114-8f5a21e914b3@amd.com>
[-- Attachment #1: Type: text/plain, Size: 9189 bytes --]
On Fri, 10 Nov 2023 15:27:03 -0500
Harry Wentland <harry.wentland@amd.com> wrote:
> On 2023-11-09 04:20, Pekka Paalanen wrote:
> > On Wed, 8 Nov 2023 11:27:35 -0500
> > Harry Wentland <harry.wentland@amd.com> wrote:
> >
> >> On 2023-11-08 11:19, Pekka Paalanen wrote:
> >>> On Wed, 8 Nov 2023 09:31:17 -0500
> >>> Harry Wentland <harry.wentland@amd.com> wrote:
> >>>
> >>>> On 2023-11-08 06:40, Sebastian Wick wrote:
> >>>>> On Wed, Nov 8, 2023 at 11:16 AM Pekka Paalanen <ppaalanen@gmail.com> wrote:
> >
> > ...
> >
> >>>>>> An incremental UAPI development approach is fine by me, meaning that
> >>>>>> pipelines might not be complete at first, but I believe that requires
> >>>>>> telling userspace whether the driver developers consider the pipeline
> >>>>>> complete (no undescribed operations that would significantly change
> >>>>>> results from the expected results given the UAPI exposed pipeline).
> >>>>>>
> >>>>>> The prime example of what I would like to know is that if a FB
> >>>>>> contains PQ-encoded image and I use a color pipeline to scale that
> >>>>>> image up, will the interpolation happen before or after the non-linear
> >>>>>> colorop that decodes PQ. That is a significant difference as pointed
> >>>>>> out by Joshua.
> >>>>>>
> >>>>
> >>>> That's fair and I want to give that to you. My concern stems from
> >>>> the sentiment that I hear that any pipeline that doesn't explicitly
> >>>> advertise this is useless. I don't agree there. Let's not let perfect
> >>>> be the enemy of good.
> >>>
> >>> It's up to the use case. The policy of what is sufficient should reside
> >>> in userspace.
> >>>
> >>> What about matching compositor shader composition with KMS?
> >>>
> >>> Can we use that as a rough precision threshold? If userspace implements
> >>> the exact same color pipeline as the KMS UAPI describes, then that and
> >>> the KMS composited result should be indistinguishable in side-by-side
> >>> or alternating visual inspection on any monitor in isolation.
> >>>
> >>> Did this whole effort not start from wanting to off-load things to
> >>> display hardware but still maintain visual equivalence to software/GPU
> >>> composition?
> >>>
> >>
> >> I agree with you and I want all that as well.
> >>
> >> All I'm saying is that every userspace won't have the same policy of
> >> what is sufficient. Just because Weston has a very high threshold
> >> doesn't mean we can't move forward with a workable solution for other
> >> userspace, as long as we don't do something that prevents us from
> >> doing the perfect solution eventually.
> >>
> >> And yes, I do want a solution that works for Weston and hear your
> >> comments on what that requires.
> >
> > I totally agree.
> >
> > How will that be reflected in the UAPI? If some pipelines are different
> > from others in correctness/strictness perspective, how will userspace
> > tell them apart?
> >
> > Is the current proposal along the lines of: userspace creates a
> > software pipeline first, and if it cannot map all operations on it to
> > KMS color pipeline colorops, then the KMS pipeline is not sufficient?
> >
> > The gist being, if the software pipeline is scaling the image for
> > example, then it must find a scaling colorop in the KMS pipeline if it
> > cares about the scaling correctness.
> >
>
> With a simplified model of an imaginary color pipeline I expect this
> to look like this:
>
> Color Pipeline 1:
> EOTF Curve - CTM
>
> Color Pipeline 2:
> EOTF Curve - scale - CTM
>
> Realistically both would most likely map to the same HW blocks.
>
> Assuming userspace A and B do the following:
> EOTF Curve - scale - CTM
>
> Userspace A doesn't care about scaling and would only look for:
> EOTF Curve - CTM
>
> and find a match with Color Pipeline 1.
>
> Userspace B cares about scaling and would look for
> EOTF Curve - scale - CTM
>
> and find a match with Color Pipeline 2.
>
> If Color Pipeline 2 is not exposed in the first iteration of the
> driver's implementation userspace A would still be able to make
> use of it, but userspace B would not, since it requires a defined
> scale operation. If the driver then exposes Color Pipeline 2 in a
> second iteration userspace B can find a match for what it needs
> and make use of it.
>
> Realistically userspace B would not attempt to implement a DRM/KMS
> color pipeline implementation unless it knows that there's a driver
> that can do what it needs.
>
> > Another example is YUV pixel format on an FB that magically turns into
> > some kind of RGB when sampled, but there is no colorop to tell what
> > happens. I suppose userspace cannot assume that the lack of colorop
> > there means an identity YUV->RGB matrix either? How to model
> > that? I guess the already mentioned pixel format requirements on a
> > pipeline would help, making it impossible to use a pipeline without a
> > YUV->RGB colorop on a YUV FB unless the lack of colorop does indeed
> > mean an identity matrix.
> >
>
> I agree.
>
> > The same with sub-sampled YUV which probably needs to always(?) be
> > expanded into fully sampled at the beginning of a pipeline? Chroma
> > siting.
> >
> > This is in addition to the previously discussed userspace policy that
> > if a KMS color pipeline contains colorops the userspace does not
> > recognise, userspace probably should not pick that pipeline under any
> > conditions, because it might do something completely unexpected.
> >
>
> Unless those colorops can be put into bypass.
>
> > I think the above could work, but I feel it requires documenting several
> > examples like scaling that might not exist in the colorop definitions
> > at first. Otherwise particularly userspace developers might not come to
> > think of them, whether they care about those operations. I haven't read
> > the latest doc yet, so I'm not sure if it's already there.
> >
>
> True.
>
> But I'm somewhat reluctant to define things that don't have an
> implementation by a driver and an associated IGT test.
Hi Harry,
you do not need to define those colorops.
All I'm asking for is that the documentation includes examples, e.g. if
you do scaling and you care about how and in which color encoding space
it is done, make sure the pipeline you pick explicitly describes that.
If one cannot find even definitions for such colorops, then obviously
they are not explicit.
People might not realise that there are more than one way to do each
thing. That goes for anything that is possible to program or even
automatically programmed without being explicit in a color pipeline,
like YUV<->RGB conversions.
Or is all this so obvious it does not need pointing out in docs?
> I've seen
> too many definitions (like the drm_connector Colorspace property)
> that define a bunch of things but it's unclear whether they are
> actually used. Once you have those you can't change their definition
> either, even if they are wrong. And you might not find out they are
> wrong until you try to implement support end-to-end.
>
> The age-old chicken-and-egg dilemma. It's really problematic to
> define things that haven't been validated end-to-end.
>
> > There is still a gap though: what if the hardware does something
> > significant that is not modelled in the KMS pipeline with colorops? For
> > example, always using a hard-wired sRGB curve to decode before blending
> > and encode after blending. Or that cursor plane always uses the color
> > pipeline set on the primary plane. How to stop userspace from being
> > surprised?
> >
>
> Yeah, it shouldn't. Anything extra that's done should be modelled with
> a colorop. But I might be somewhat contradicting myself here because
> this would mean that we'd need to model scaling.
Exactly. If unknowns need to be allowed at first, there should be some
indication to userspace when all unknowns in a pipeline have been
eliminated (either explicitly modelled, or guaranteed to bypass). Most
userspace won't care, but those who would need the new color pipeline
UAPI the most will.
> Cursors are funky on AMD and I need to think about them more (though
> I've been saying that for years :D ). Maybe on AMD we might want a
> custom colorop for cursors that basically says "this plane will inherit
> colorops from the underlying plane".
Sounds good to me.
Is it really any underlying plane at that point (pixel by pixel?) and
not the primary plane?
> > Your comments sounded to me like you are letting go of the original
> > design goals. I'm happy to hear that's not the case. Even if you were,
> > that is a decision you can make since you are doing the work, and if I
> > knew you're doing that intentionally I would stop complaining.
> >
>
> Apologies for the misunderstanding. I agree with the original design
> goals but I'm also trying to find a minimal workable solution that
> allows us to iterate and improve on it going forward.
That's all fine.
Thanks,
pq
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-11-13 10:01 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 15:02 [RFC PATCH 00/10] Color Pipeline API w/ VKMS Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 01/10] drm/doc/rfc: Describe why prescriptive color pipeline is needed Harry Wentland
2023-09-08 19:30 ` Sebastian Wick
2023-09-08 20:38 ` Harry Wentland
2023-09-13 11:53 ` Pekka Paalanen
2023-09-13 11:29 ` Pekka Paalanen
2023-10-19 14:56 ` Harry Wentland
2023-10-20 10:17 ` Pekka Paalanen
2023-11-06 16:24 ` Harry Wentland
2023-11-07 9:38 ` Pekka Paalanen
2023-11-07 15:39 ` Harry Wentland
2023-10-10 16:13 ` Melissa Wen
2023-10-11 10:20 ` Pekka Paalanen
2023-10-11 19:12 ` Sebastian Wick
2023-10-19 14:56 ` Harry Wentland
2023-10-20 10:36 ` Pekka Paalanen
2023-11-06 16:19 ` Harry Wentland
2023-11-07 9:55 ` Pekka Paalanen
2023-11-07 16:58 ` Harry Wentland
2023-11-08 10:16 ` Pekka Paalanen
2023-11-08 11:40 ` Sebastian Wick
2023-11-08 14:31 ` Harry Wentland
2023-11-08 16:19 ` Pekka Paalanen
2023-11-08 16:27 ` Harry Wentland
2023-11-09 9:20 ` Pekka Paalanen
2023-11-10 20:27 ` Harry Wentland
2023-11-13 10:01 ` Pekka Paalanen [this message]
2023-09-08 15:02 ` [RFC PATCH 02/10] drm/colorop: Introduce new drm_colorop mode object Harry Wentland
2023-10-10 16:19 ` Melissa Wen
2023-10-19 15:01 ` Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 03/10] drm/colorop: Add TYPE property Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 04/10] drm/color: Add 1D Curve subtype Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 05/10] drm/colorop: Add BYPASS property Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 06/10] drm/colorop: Add NEXT property Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 07/10] drm/colorop: Add atomic state print for drm_colorop Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 08/10] drm/colorop: Add new IOCTLs to retrieve drm_colorop objects Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 09/10] drm/plane: Add COLOR PIPELINE property Harry Wentland
2023-09-08 15:02 ` [RFC PATCH 10/10] drm/vkms: Add enumerated 1D curve colorop Harry Wentland
2023-10-10 16:27 ` Melissa Wen
2023-10-19 15:50 ` Harry Wentland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231113120134.5791b90d@eldfell \
--to=ppaalanen@gmail.com \
--cc=aleixpol@kde.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=jadahl@redhat.com \
--cc=joshua@froggi.es \
--cc=mdaenzer@redhat.com \
--cc=mwen@igalia.com \
--cc=quic_cbraga@quicinc.com \
--cc=quic_naseer@quicinc.com \
--cc=sebastian.wick@redhat.com \
--cc=shashank.sharma@amd.com \
--cc=uma.shankar@intel.com \
--cc=victoria@system76.com \
--cc=wayland-devel@lists.freedesktop.org \
--cc=xaver.hugl@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.