From: Pekka Paalanen <ppaalanen@gmail.com>
To: Melissa Wen <mwen@igalia.com>
Cc: "Sebastian Wick" <sebastian.wick@redhat.com>,
"Shashank Sharma" <shashank.sharma@amd.com>,
dri-devel@lists.freedesktop.org,
wayland-devel@lists.freedesktop.org,
"Xaver Hugl" <xaver.hugl@gmail.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: Wed, 11 Oct 2023 13:20:05 +0300 [thread overview]
Message-ID: <20231011132005.43d2a86a@eldfell> (raw)
In-Reply-To: <20231010161322.topz6zfealkxtwjj@mail.igalia.com>
[-- Attachment #1: Type: text/plain, Size: 7914 bytes --]
On Tue, 10 Oct 2023 15:13:46 -0100
Melissa Wen <mwen@igalia.com> wrote:
> O 09/08, Harry Wentland wrote:
> > Signed-off-by: Harry Wentland <harry.wentland@amd.com>
> > Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> > Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
> > Cc: Simon Ser <contact@emersion.fr>
> > Cc: Harry Wentland <harry.wentland@amd.com>
> > Cc: Melissa Wen <mwen@igalia.com>
> > Cc: Jonas Ådahl <jadahl@redhat.com>
> > Cc: Sebastian Wick <sebastian.wick@redhat.com>
> > Cc: Shashank Sharma <shashank.sharma@amd.com>
> > Cc: Alexander Goins <agoins@nvidia.com>
> > Cc: Joshua Ashton <joshua@froggi.es>
> > Cc: Michel Dänzer <mdaenzer@redhat.com>
> > Cc: Aleix Pol <aleixpol@kde.org>
> > Cc: Xaver Hugl <xaver.hugl@gmail.com>
> > Cc: Victoria Brekenfeld <victoria@system76.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Uma Shankar <uma.shankar@intel.com>
> > Cc: Naseer Ahmed <quic_naseer@quicinc.com>
> > Cc: Christopher Braga <quic_cbraga@quicinc.com>
> > ---
> > Documentation/gpu/rfc/color_pipeline.rst | 278 +++++++++++++++++++++++
> > 1 file changed, 278 insertions(+)
> > create mode 100644 Documentation/gpu/rfc/color_pipeline.rst
> >
> > diff --git a/Documentation/gpu/rfc/color_pipeline.rst b/Documentation/gpu/rfc/color_pipeline.rst
> > new file mode 100644
> > index 000000000000..bfa4a8f12087
> > --- /dev/null
> > +++ b/Documentation/gpu/rfc/color_pipeline.rst
...
> > +Color Pipeline Discovery
> > +========================
> > +
> > +A DRM client wanting color management on a drm_plane will:
> > +
> > +1. Read all drm_colorop objects
> > +2. Get the COLOR_PIPELINE property of the plane
> > +3. iterate all COLOR_PIPELINE enum values
> > +4. for each enum value walk the color pipeline (via the NEXT pointers)
> > + and see if the available color operations are suitable for the
> > + desired color management operations
> > +
> > +An example of chained properties to define an AMD pre-blending color
> > +pipeline might look like this::
>
> Hi Harry,
>
> Thanks for sharing this proposal. Overall I think it's very aligned with
> Simon's description of the generic KMS color API. I think it's a good
> start point and we can refine over iterations. My general questions have
> already been pointed out by Sebastian and Pekka (mainly regarding the
> BYPASS property).
>
> I still have some doubts on how to fit these set of colorops with some
> AMD corners cases as below:
>
> > +
> > + Plane 10
> > + ├─ "type": immutable enum {Overlay, Primary, Cursor} = Primary
> > + └─ "color_pipeline": enum {0, 42} = 0
> > + Color operation 42 (input CSC)
> > + ├─ "type": enum {Bypass, Matrix} = Matrix
> > + ├─ "matrix_data": blob
> > + └─ "next": immutable color operation ID = 43
>
> IIUC, for input CSC, there are currently two possiblities, or we use
> `drm_plane_color_encoding` and `drm_plane_color range` to get
> pre-defined coefficients or we set a custom matrix here, right? If so, I
> think we need some kind of pre-defined matrix option?
>
> Also, with this new plane API in place, I understand that we will
> already need think on how to deal with the mixing between old drm color
> properties (color encoding and color range) and these new way of setting
> plane color properties. IIUC, Pekka asked a related question about it
> when talking about CRTC automatic RGB->YUV (?)
I didn't realize color encoding and color range KMS plane properties
even existed. There is even color space on rockchip!
https://drmdb.emersion.fr/properties?object-type=4008636142
That list has even more conflicts: DEGAMMA_MODE, EOTF, FEATURE,
NV_INPUT_COLORSPACE, SCALING_FILTER, WATERMARK, alpha, GLOBAL_ALPHA,
brightness, colorkey, contrast, and more. I hope most of them are
actually from downstream drivers.
I think they should be forbidden to be used together with the new
pipeline UAPI. Mixing does not work in the long run, it would be
undefined at what position do the old properties apply in a pipeline.
Apparently, we already need a DRM client cap for the new color pipeline
UAPI to hide these legacy things.
This is different from "CRTC automatic RGB->YUV", because the CRTC
thing is chosen silently by the driver and there is nothing after it.
Those old plane properties are explicitly programmed by userspace.
Thanks,
pq
> > + Color operation 43
> > + ├─ "type": enum {Scaling} = Scaling
> > + └─ "next": immutable color operation ID = 44
> > + Color operation 44 (DeGamma)
> > + ├─ "type": enum {Bypass, 1D curve} = 1D curve
> > + ├─ "1d_curve_type": enum {sRGB, PQ, …} = sRGB
> > + └─ "next": immutable color operation ID = 45
> > + Color operation 45 (gamut remap)
> > + ├─ "type": enum {Bypass, Matrix} = Matrix
> > + ├─ "matrix_data": blob
> > + └─ "next": immutable color operation ID = 46
> > + Color operation 46 (shaper LUT RAM)
> > + ├─ "type": enum {Bypass, 1D curve} = 1D curve
> > + ├─ "1d_curve_type": enum {LUT} = LUT
> > + ├─ "lut_size": immutable range = 4096
> > + ├─ "lut_data": blob
> > + └─ "next": immutable color operation ID = 47
>
> For shaper and blend LUT RAM, that the driver supports pre-defined
> curves and custom LUT at the same time but the resulted LUT is a
> combination of those, how to make this behavior clear? Could this
> behavior be described by two colorop in a row: for example, one for
> shaper TF and,just after, another for shaper LUT or would it not be the
> right representation?
>
> > + Color operation 47 (3D LUT RAM)
> > + ├─ "type": enum {Bypass, 3D LUT} = 3D LUT
> > + ├─ "lut_size": immutable range = 17
> > + ├─ "lut_data": blob
> > + └─ "next": immutable color operation ID = 48
> > + Color operation 48 (blend gamma)
> > + ├─ "type": enum {Bypass, 1D curve} = 1D curve
> > + ├─ "1d_curve_type": enum {LUT, sRGB, PQ, …} = LUT
> > + ├─ "lut_size": immutable range = 4096
> > + ├─ "lut_data": blob
> > + └─ "next": immutable color operation ID = 0
> > +
> > +
> > +Color Pipeline Programming
> > +==========================
> > +
> > +Once a DRM client has found a suitable pipeline it will:
> > +
> > +1. Set the COLOR_PIPELINE enum value to the one pointing at the first
> > + drm_colorop object of the desired pipeline
> > +2. Set the properties for all drm_colorop objects in the pipeline to the
> > + desired values, setting BYPASS to true for unused drm_colorop blocks,
> > + and false for enabled drm_colorop blocks
> > +3. Perform atomic_check/commit as desired
> > +
> > +To configure the pipeline for an HDR10 PQ plane and blending in linear
> > +space, a compositor might perform an atomic commit with the following
> > +property values::
> > +
> > + Plane 10
> > + └─ "color_pipeline" = 42
> > + Color operation 42 (input CSC)
> > + └─ "bypass" = true
> > + Color operation 44 (DeGamma)
> > + └─ "bypass" = true
> > + Color operation 45 (gamut remap)
> > + └─ "bypasse" = true
> > + Color operation 46 (shaper LUT RAM)
> > + └─ "bypass" = true
> > + Color operation 47 (3D LUT RAM)
> > + └─ "lut_data" = Gamut mapping + tone mapping + night mode
> > + Color operation 48 (blend gamma)
> > + └─ "1d_curve_type" = PQ inverse EOTF
>
> Isn't it a PQ EOTF for blend gamma?
>
> Best Regards,
>
> Melissa
>
> > +
> > +
> > +References
> > +==========
> > +
> > +1. https://lore.kernel.org/dri-devel/QMers3awXvNCQlyhWdTtsPwkp5ie9bze_hD5nAccFW7a_RXlWjYB7MoUW_8CKLT2bSQwIXVi5H6VULYIxCdgvryZoAoJnC5lZgyK1QWn488=@emersion.fr/
> > \ No newline at end of file
> > --
> > 2.42.0
> >
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-10-11 10:20 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 [this message]
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
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=20231011132005.43d2a86a@eldfell \
--to=ppaalanen@gmail.com \
--cc=aleixpol@kde.org \
--cc=dri-devel@lists.freedesktop.org \
--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.