From: Pekka Paalanen <pekka.paalanen@collabora.com>
To: Alex Hung <alex.hung@amd.com>
Cc: Xaver Hugl <xaver.hugl@gmail.com>,
Sebastian Wick <sebastian.wick@redhat.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
wayland-devel@lists.freedesktop.org, harry.wentland@amd.com,
leo.liu@amd.com, ville.syrjala@linux.intel.com,
contact@emersion.fr, mwen@igalia.com, jadahl@redhat.com,
shashank.sharma@amd.com, agoins@nvidia.com, joshua@froggi.es,
mdaenzer@redhat.com, aleixpol@kde.org, victoria@system76.com,
daniel@ffwll.ch, uma.shankar@intel.com, quic_naseer@quicinc.com,
quic_cbraga@quicinc.com, quic_abhinavk@quicinc.com,
marcan@marcan.st, Liviu.Dudau@arm.com, sashamcintosh@google.com,
chaitanya.kumar.borah@intel.com, louis.chauvet@bootlin.com,
mcanal@igalia.com, nfraprado@collabora.com,
Daniel Stone <daniels@collabora.com>
Subject: Re: [PATCH V11 06/47] drm/colorop: Add 1D Curve subtype
Date: Thu, 25 Sep 2025 11:11:36 +0300 [thread overview]
Message-ID: <20250925110238.5f872e69@eldfell> (raw)
In-Reply-To: <b8abcab1-3953-410a-b639-5a74f9d2819e@amd.com>
[-- Attachment #1: Type: text/plain, Size: 5433 bytes --]
On Tue, 23 Sep 2025 11:41:24 -0600
Alex Hung <alex.hung@amd.com> wrote:
> On 9/23/25 10:16, Alex Hung wrote:
> >
> >
> > On 9/23/25 01:59, Pekka Paalanen wrote:
> >> On Mon, 22 Sep 2025 21:16:45 -0600
> >> Alex Hung <alex.hung@amd.com> wrote:
> >>
> >>> On 9/18/25 02:40, Pekka Paalanen wrote:
...
> >> The problem is that "H.273 TransferCharacteristics code point 13" a.k.a
> >> the sRGB curve means different things for different people (two-piece
> >> vs. power-2.2).
> >>
> >> The difference is minor but visible, and therefore I would not make
> >> two-piece and power-2.2 equivalent nor have one approximated by the
> >> other.
> >>
> >> They both need their own entries in the enum. Let's leave any decision
> >> about whether substituting one for the other is ok to the userspace.
> >>
> >>> */
> >>> DRM_COLOROP_1D_CURVE_SRGB_EOTF,
> >>>
> >>>
> >>> It is also possible to add GAMMA 2.2 in addition to sRGB piece-wise
> >>> EOTF. But if I understand correctly, DRM_COLOROP_1D_CURVE_SRGB_EOTF may
> >>> not be used at all, right?
> >>
> >> If hardware implements the two-piece curve, then there is reason to
> >> expose it, especially when it does not implement power-2.2. Userspace
> >> can choose to use it as an approximation when that is appropriate.
> >>
> >>
> >> Thanks,
> >> pq
> >>
> >
> > Does the following diff make sense?
Yes.
> >
> > 1. Change "sRGB EOTF" -> "Piece-wise EOTF"
> > 2. Add "Gamma 2.2"
> >
> > diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
> > index e1b2b446faf2..823e39b8f3fe 100644
> > --- a/drivers/gpu/drm/drm_colorop.c
> > +++ b/drivers/gpu/drm/drm_colorop.c
> > @@ -71,12 +71,13 @@ static const struct drm_prop_enum_list
> > drm_colorop_type_enum_list[] = {
> > };
> >
> > static const char * const colorop_curve_1d_type_names[] = {
> > - [DRM_COLOROP_1D_CURVE_SRGB_EOTF] = "sRGB EOTF",
> > + [DRM_COLOROP_1D_CURVE_SRGB_EOTF] = "Piece-wise EOTF",
> > [DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF] = "sRGB Inverse EOTF",
> > [DRM_COLOROP_1D_CURVE_PQ_125_EOTF] = "PQ 125 EOTF",
> > [DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF] = "PQ 125 Inverse EOTF",
> > [DRM_COLOROP_1D_CURVE_BT2020_INV_OETF] = "BT.2020 Inverse OETF",
> > [DRM_COLOROP_1D_CURVE_BT2020_OETF] = "BT.2020 OETF",
> > + [DRM_COLOROP_1D_CURVE_GAMMA22] = "Gamma 2.2",
If I wanted to really nitpick, I'd propose "Power 2.2" instead of
"Gamma 2.2", but I suppose it's clear anyway. And Wayland already went
with GAMMA22.
> > };
> >
> > static const struct drm_prop_enum_list
> > drm_colorop_lut1d_interpolation_list[] = {
> > diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h
> > index 3e70f66940e0..3428a27cd9ad 100644
> > --- a/include/drm/drm_colorop.h
> > +++ b/include/drm/drm_colorop.hsRGB EOTF
> > @@ -43,12 +43,9 @@ enum drm_colorop_curve_1d_type {
> > /**
> > * @DRM_COLOROP_1D_CURVE_SRGB_EOTF:
> > *
> > - * enum string "sRGB EOTF"
> > + * enum string "Piece-wise EOTF"
> > *
> > - * sRGB piece-wise electro-optical transfer function. Transfer
> > - * characteristics as defined by IEC 61966-2-1 sRGB. Equivalent
> > - * to H.273 TransferCharacteristics code point 13 with
> > - * MatrixCoefficients set to 0.
> > + * sRGB piece-wise electro-optical transfer function.
> > */
> > DRM_COLOROP_1D_CURVE_SRGB_EOTF,
> >
> > @@ -108,6 +105,16 @@ enum drm_colorop_curve_1d_type {
> > */
> > DRM_COLOROP_1D_CURVE_BT2020_OETF,
> >
> > + /**
> > + * @DRM_COLOROP_1D_CURVE_GAMMA22:
> > + *
> > + * enum string "Gamma 2.2"
> > + *
> > + * A gamma 2.2 power function. This applies a power curve with
> > + * gamma value of 2.2 to the input values.
I'd prefer "exponent" rather than "gamma value" to be more explicit.
Just in case. There is quite some confusion around the term "gamma".
I've used to call this function a "pure power-low with exponent 2.2" to
explain that there are no offsets or multipliers or anything else.
For documentation it would best to write down the mathematical formula
rather than describe it in words. I understand that may be problematic
in kerneldoc, and we didn't do it in Wayland XML either but in a
proposed Gitlab-Markdown appendix.
> > + */
> > + DRM_COLOROP_1D_CURVE_GAMMA22,
> > +
> > /**
> > * @DRM_COLOROP_1D_CURVE_COUNT:
> > *
> >
>
> Both DRM_COLOROP_1D_CURVE_SRGB_EOTF and DRM_COLOROP_1D_CURVE_GAMMA22 are
> defined and it should be clear that sRGB EOTF are piece-wise TF and
> Gamma 2.2 is for power 2.2. Is it still a concern of using "sRGB" for as
> the original patch?
Not enough of a concern for me to continue nagging about it. :-)
> More precisely, adding DRM_COLOROP_1D_CURVE_GAMMA22 with "Gamma 2.2"
> string without touching "sRGB EOTF" should be sufficient. If a userspace
> need to choose one or another it can precisely do so.
>
As long as everyone reads the documentation, and the documentation is
clear. I failed at clarity in Wayland, so I'm perhaps a bit paranoid
here.
Thanks,
pq
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-09-25 12:51 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 3:49 [PATCH V11 00/47] Color Pipeline API w/ VKMS Alex Hung
2025-08-15 3:49 ` [PATCH V11 01/47] drm: Add helper for conversion from signed-magnitude Alex Hung
2025-08-15 3:49 ` [PATCH V11 02/47] drm/vkms: Add kunit tests for VKMS LUT handling Alex Hung
2025-08-15 18:48 ` kernel test robot
2025-08-15 21:26 ` kernel test robot
2025-09-19 12:43 ` Louis Chauvet
2025-08-15 3:49 ` [PATCH V11 03/47] drm/doc/rfc: Describe why prescriptive color pipeline is needed Alex Hung
2025-08-15 3:49 ` [PATCH V11 04/47] drm/colorop: Introduce new drm_colorop mode object Alex Hung
2025-08-15 3:49 ` [PATCH V11 05/47] drm/colorop: Add TYPE property Alex Hung
2025-08-15 3:49 ` [PATCH V11 06/47] drm/colorop: Add 1D Curve subtype Alex Hung
2025-08-19 15:11 ` Sebastian Wick
2025-08-21 12:23 ` Xaver Hugl
2025-08-21 17:54 ` Alex Hung
2025-08-26 9:03 ` Pekka Paalanen
2025-09-16 23:01 ` Alex Hung
2025-09-18 8:40 ` Pekka Paalanen
2025-09-23 3:16 ` Alex Hung
2025-09-23 7:59 ` Pekka Paalanen
2025-09-23 14:03 ` Alex Hung
2025-09-23 16:16 ` Alex Hung
2025-09-23 17:41 ` Alex Hung
2025-09-25 8:11 ` Pekka Paalanen [this message]
2025-09-25 18:22 ` Harry Wentland
2025-09-27 18:35 ` Shengyu Qu
2025-08-15 3:49 ` [PATCH V11 07/47] drm/colorop: Add BYPASS property Alex Hung
2025-08-19 15:15 ` Sebastian Wick
2025-08-20 17:57 ` Alex Hung
2025-08-15 3:49 ` [PATCH V11 08/47] drm/colorop: Add NEXT property Alex Hung
2025-08-15 3:49 ` [PATCH V11 09/47] drm/colorop: Add atomic state print for drm_colorop Alex Hung
2025-08-15 3:49 ` [PATCH V11 10/47] drm/plane: Add COLOR PIPELINE property Alex Hung
2025-08-15 3:50 ` [PATCH V11 11/47] drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE Alex Hung
2025-09-15 18:43 ` Nícolas F. R. A. Prado
2025-09-17 2:23 ` Alex Hung
2025-08-15 3:50 ` [PATCH V11 12/47] Documentation/gpu: document drm_colorop Alex Hung
2025-08-15 3:50 ` [PATCH V11 13/47] drm/colorop: Add destroy functions for color pipeline Alex Hung
2025-09-05 17:12 ` Louis Chauvet
2025-09-17 2:01 ` Alex Hung
2025-09-17 15:31 ` Nícolas F. R. A. Prado
2025-09-18 0:50 ` Alex Hung
2025-08-15 3:50 ` [PATCH V11 14/47] drm/vkms: Add enumerated 1D curve colorop Alex Hung
2025-09-05 17:12 ` Louis Chauvet
2025-09-17 1:54 ` Alex Hung
2025-09-17 14:47 ` Nícolas F. R. A. Prado
2025-09-18 0:45 ` Alex Hung
2025-09-19 12:49 ` Louis Chauvet
2025-09-20 3:31 ` Alex Hung
2025-09-22 8:27 ` Louis Chauvet
2025-08-15 3:50 ` [PATCH V11 15/47] drm/vkms: Add kunit tests for linear and sRGB LUTs Alex Hung
2025-08-15 20:34 ` kernel test robot
2025-08-15 3:50 ` [PATCH V11 16/47] drm/colorop: Add 3x4 CTM type Alex Hung
2025-08-15 3:50 ` [PATCH V11 17/47] drm/vkms: Use s32 for internal color pipeline precision Alex Hung
2025-09-30 7:07 ` Pekka Paalanen
2025-09-30 13:58 ` Harry Wentland
2025-08-15 3:50 ` [PATCH V11 18/47] drm/vkms: add 3x4 matrix in color pipeline Alex Hung
2025-08-15 3:50 ` [PATCH V11 19/47] drm/tests: Add a few tests around drm_fixed.h Alex Hung
2025-08-15 3:50 ` [PATCH V11 20/47] drm/vkms: Add tests for CTM handling Alex Hung
2025-08-15 3:50 ` [PATCH V11 21/47] drm/colorop: pass plane_color_pipeline client cap to atomic check Alex Hung
2025-08-15 3:50 ` [PATCH V11 22/47] drm/colorop: define a new macro for_each_new_colorop_in_state Alex Hung
2025-08-15 3:50 ` [PATCH V11 23/47] drm/amd/display: Ignore deprecated props when plane_color_pipeline set Alex Hung
2025-08-15 3:50 ` [PATCH V11 24/47] drm/amd/display: Add bypass COLOR PIPELINE Alex Hung
2025-08-15 3:50 ` [PATCH V11 25/47] drm/amd/display: Skip color pipeline initialization for cursor plane Alex Hung
2025-08-15 3:50 ` [PATCH V11 26/47] drm/amd/display: Add support for sRGB EOTF in DEGAM block Alex Hung
2025-08-15 3:50 ` [PATCH V11 27/47] drm/amd/display: Add support for sRGB Inverse EOTF in SHAPER block Alex Hung
2025-08-15 3:50 ` [PATCH V11 28/47] drm/amd/display: Add support for sRGB EOTF in BLND block Alex Hung
2025-08-16 2:21 ` kernel test robot
2025-08-15 3:50 ` [PATCH V11 29/47] drm/colorop: Add PQ 125 EOTF and its inverse Alex Hung
2025-08-15 3:50 ` [PATCH V11 30/47] drm/amd/display: Enable support for PQ 125 EOTF and Inverse Alex Hung
2025-08-15 3:50 ` [PATCH V11 31/47] drm/colorop: add BT2020/BT709 OETF and Inverse OETF Alex Hung
2025-08-15 17:54 ` Qu Shengyu
2025-08-15 19:26 ` Alex Hung
2025-08-16 2:45 ` Shengyu Qu
2025-08-16 3:28 ` Alex Hung
2025-09-18 9:26 ` Pekka Paalanen
2025-08-15 3:50 ` [PATCH V11 32/47] drm/amd/display: Add support for BT.709 and BT.2020 TFs Alex Hung
2025-08-15 3:50 ` [PATCH V11 33/47] drm: Add Enhanced LUT precision structure Alex Hung
2025-08-15 3:50 ` [PATCH V11 34/47] drm: Add helper to extract lut from struct drm_color_lut32 Alex Hung
2025-08-15 3:50 ` [PATCH V11 35/47] drm/colorop: Add 1D Curve Custom LUT type Alex Hung
2025-08-19 15:31 ` Sebastian Wick
2025-08-20 18:16 ` Alex Hung
2025-08-20 19:40 ` Sebastian Wick
2025-08-21 12:18 ` Xaver Hugl
2025-08-15 3:50 ` [PATCH V11 36/47] drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUT Alex Hung
2025-08-15 3:50 ` [PATCH V11 37/47] drm/amd/display: add 3x4 matrix colorop Alex Hung
2025-08-15 3:50 ` [PATCH V11 38/47] drm/colorop: Add multiplier type Alex Hung
2025-08-15 3:50 ` [PATCH V11 39/47] drm/amd/display: add multiplier colorop Alex Hung
2025-08-15 3:50 ` [PATCH V11 40/47] drm/amd/display: Swap matrix and multiplier Alex Hung
2025-08-15 3:50 ` [PATCH V11 41/47] drm/colorop: Define LUT_1D interpolation Alex Hung
2025-08-15 3:50 ` [PATCH V11 42/47] drm/colorop: allow non-bypass colorops Alex Hung
2025-08-15 3:50 ` [PATCH V11 43/47] drm/colorop: Add 3D LUT support to color pipeline Alex Hung
2025-08-15 3:50 ` [PATCH V11 44/47] drm/amd/display: add 3D LUT colorop Alex Hung
2025-08-15 3:50 ` [PATCH V11 45/47] drm/amd/display: Add AMD color pipeline doc Alex Hung
2025-08-15 3:50 ` [PATCH V11 46/47] drm/amd/display: Ensure 3D LUT for color pipeline Alex Hung
2025-08-15 3:50 ` [PATCH V11 47/47] drm/amd/display: Disable CRTC degamma when color pipeline is enabled Alex Hung
2025-08-20 19:43 ` [PATCH V11 00/47] Color Pipeline API w/ VKMS Sebastian Wick
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=20250925110238.5f872e69@eldfell \
--to=pekka.paalanen@collabora.com \
--cc=Liviu.Dudau@arm.com \
--cc=agoins@nvidia.com \
--cc=aleixpol@kde.org \
--cc=alex.hung@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=chaitanya.kumar.borah@intel.com \
--cc=contact@emersion.fr \
--cc=daniel@ffwll.ch \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=jadahl@redhat.com \
--cc=joshua@froggi.es \
--cc=leo.liu@amd.com \
--cc=louis.chauvet@bootlin.com \
--cc=marcan@marcan.st \
--cc=mcanal@igalia.com \
--cc=mdaenzer@redhat.com \
--cc=mwen@igalia.com \
--cc=nfraprado@collabora.com \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_cbraga@quicinc.com \
--cc=quic_naseer@quicinc.com \
--cc=sashamcintosh@google.com \
--cc=sebastian.wick@redhat.com \
--cc=shashank.sharma@amd.com \
--cc=uma.shankar@intel.com \
--cc=victoria@system76.com \
--cc=ville.syrjala@linux.intel.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.