All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <pekka.paalanen@collabora.com>
To: "Borah, Chaitanya Kumar" <chaitanya.kumar.borah@intel.com>
Cc: Robert Mader <robert.mader@collabora.com>,
	Harry Wentland <harry.wentland@amd.com>,
	<dri-devel@lists.freedesktop.org>,
	<amd-gfx@lists.freedesktop.org>, Melissa Wen <mwen@igalia.com>
Subject: Re: [PATCH v4 01/11] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX
Date: Thu, 30 Jul 2026 17:27:58 +0300	[thread overview]
Message-ID: <20260730172758.0c65485f@fluorite> (raw)
In-Reply-To: <8aaeb5b2-2706-415a-8662-40f863270dac@intel.com>

[-- Attachment #1: Type: text/plain, Size: 5136 bytes --]

On Tue, 28 Jul 2026 21:30:14 +0530
"Borah, Chaitanya Kumar" <chaitanya.kumar.borah@intel.com> wrote:

> Hello Rober,
> 
> On 7/28/2026 8:32 PM, Robert Mader wrote:
> > Hi,
> > 
> > On 22.07.26 15:45, Harry Wentland wrote:  
> >> From: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
> >>
> >> Introduce DRM_COLOROP_FIXED_MATRIX, a new colorop type representing a
> >> hardware that performs a fixed matrix operation.
> >>
> >> Unlike CTM-based colorops, this block does not expose programmable
> >> coefficients. Instead, userspace selects one of the predefined
> >> hardware modes via a new FIXED_MATRIX_TYPE enum property. Supported modes
> >> include common YCbCr->RGB and RGB709->RGB2020 conversions.
> >>
> >> v4:
> >>   - Add limited-range YCbCr-RGB conversion matrix enums (Robert)
> >>   - Document matrix values (Pekka)
> >>   - Clarify RGB709 to RGB2020 is a full-range matrix (Pekka)
> >>   - Fix confusing "CSC preset" doc (Pekka)
> >>
> >> v2:
> >>   - Naming changes (Pekka)
> >>
> >> v3:
> >>   - Fix NC matrix enum name and string (Melissa)
> >>   - Rebase
> >>
> >> Co-developed-by: Harry Wentland <harry.wentland@amd.com>
> >> Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
> >> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
> >> Reviewed-by: Melissa Wen <mwen@igalia.com>
> >> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> >> Reviewed-by: Robert Mader <robert.mader@collabora.com>
> >> ---
> >>   drivers/gpu/drm/drm_atomic.c      |   4 +
> >>   drivers/gpu/drm/drm_atomic_uapi.c |   7 ++
> >>   drivers/gpu/drm/drm_colorop.c     | 109 ++++++++++++++++++++
> >>   include/drm/drm_colorop.h         | 159 ++++++++++++++++++++++++++++++
> >>   include/uapi/drm/drm_mode.h       |  12 +++
> >>   5 files changed, 291 insertions(+)
> >>

> >> diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/ 
> >> drm_colorop.c
> >> index 682fcc651525..e7ccf7d053b8 100644
> >> --- a/drivers/gpu/drm/drm_colorop.c
> >> +++ b/drivers/gpu/drm/drm_colorop.c
> >> @@ -68,6 +68,7 @@ static const struct drm_prop_enum_list 
> >> drm_colorop_type_enum_list[] = {
> >>       { DRM_COLOROP_CTM_3X4, "3x4 Matrix"},
> >>       { DRM_COLOROP_MULTIPLIER, "Multiplier"},
> >>       { DRM_COLOROP_3D_LUT, "3D LUT"},
> >> +    { DRM_COLOROP_FIXED_MATRIX, "Fixed Matrix"},
> >>   };
> >>   static const char * const colorop_curve_1d_type_names[] = {
> >> @@ -90,6 +91,17 @@ static const struct drm_prop_enum_list 
> >> drm_colorop_lut3d_interpolation_list[] =
> >>       { DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL, "Tetrahedral" },
> >>   };
> >> +static const char * const colorop_fixed_matrix_type_names[] = {
> >> +    [DRM_COLOROP_FM_YCBCR601_FULL_RGB] = "YCbCr 601 Full to RGB",
> >> +    [DRM_COLOROP_FM_YCBCR601_LIMITED_RGB] = "YCbCr 601 Limited to RGB",
> >> +    [DRM_COLOROP_FM_YCBCR709_FULL_RGB] = "YCbCr 709 Full to RGB",
> >> +    [DRM_COLOROP_FM_YCBCR709_LIMITED_RGB] = "YCbCr 709 Limited to RGB",
> >> +    [DRM_COLOROP_FM_YCBCR2020_NC_FULL_RGB] = "YCbCr 2020 NC Full to 
> >> RGB",
> >> +    [DRM_COLOROP_FM_YCBCR2020_NC_LIMITED_RGB] = "YCbCr 2020 NC 
> >> Limited to RGB",
> >> +    [DRM_COLOROP_FM_YCBCR_LIMITED_FULL] = "YCbCr limited to full",
> >> +    [DRM_COLOROP_FM_RGB709_RGB2020] = "RGB709 to RGB2020",  
> > 
> > I'm still a bit unsure how useful the later two values are,  
> 
> You can see them being used in [1] and tested by [2]. We split out the 
> "YCbCr limited to full" block because some Intel planes have a 1DLUT 
> between it and the "YCbCr XXX Full to RGB" block. This keeps the color 
> pipeline consistent with the actual HW.

Hi Chaitanya,

it would be nice for VKMS to be able to have such a color
pipeline only. Then userspace authors can test it.

That gives me the idea, that perhaps there should be a library of color
pipelines for VKMS that replicates actual hardware pipelines. Maybe it
would be in the kernel, or maybe it would be in some userspace project
if VKMS pipelines can be crafted through configfs or something else.

> Based on your experience implementing the colorop in weston, do you 
> foresee any challenges in supporting limited-range framebuffers using 
> the "YCbCr Limited-to-Full" fixed matrix block?

I cannot imagine a big problem, but it is yet another configuration
that userspace must be explicitly prepared for.


Thanks,
pq


> As for the "RGB709 to RGB2020" block, I can see it being useful for 
> converting SDR Rec.709 content into the Rec.2020 color space before 
> blending it with an HDR plane.
> 
> ==
> Chaitanya
> 
> 
> [1] 
> https://lore.kernel.org/dri-devel/20260720045131.971650-1-chaitanya.kumar.borah@intel.com/
> [2] 
> https://lore.kernel.org/igt-dev/20260727185531.4046807-1-swati2.sharma@intel.com/
> 
> especially
> > as they are not implemented in this series - IMO they should be left out 
> > and be part of the corresponding Intel series.
> > 
> > Anyway, still R-B
> >   

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-07-30 14:28 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 13:45 [PATCH v4 00/11] YUV conversion colorop with amdgpu and VKMS Harry Wentland
2026-07-22 13:45 ` [PATCH v4 01/11] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX Harry Wentland
2026-07-22 13:55   ` sashiko-bot
2026-07-25  6:02   ` Alex Hung
2026-07-28 15:02   ` Robert Mader
2026-07-28 16:00     ` Borah, Chaitanya Kumar
2026-07-30 14:27       ` Pekka Paalanen [this message]
2026-07-30 14:45         ` Borah, Chaitanya Kumar
2026-07-28 15:31   ` Robert Mader
2026-07-30 10:59   ` Pekka Paalanen
2026-07-22 13:45 ` [PATCH v4 02/11] drm/vkms: Fix limited-range YCbCr to RGB conversion scaling Harry Wentland
2026-07-25  6:02   ` Alex Hung
2026-07-28 15:11   ` Robert Mader
2026-07-30 13:46   ` Pekka Paalanen
2026-07-22 13:45 ` [PATCH v4 03/11] drm/vkms: Add KUnit test for YCbCr to RGB conversion matrices Harry Wentland
2026-07-22 14:01   ` sashiko-bot
2026-07-25  6:02   ` Alex Hung
2026-07-28 15:17   ` Robert Mader
2026-07-30 14:19     ` Pekka Paalanen
2026-07-22 13:46 ` [PATCH v4 04/11] drm/vkms: Add fixed matrix colorop to color pipeline Harry Wentland
2026-07-22 13:46 ` [PATCH v4 05/11] drm/vkms: Add atomic check and matrix handling for fixed matrix colorop Harry Wentland
2026-07-22 13:59   ` sashiko-bot
2026-07-22 13:46 ` [PATCH v4 06/11] drm/amd/display: Add fixed matrix colorop to color pipeline Harry Wentland
2026-07-22 14:03   ` sashiko-bot
2026-07-28 16:00   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 07/11] drm/amd/display: Implement fixed matrix colorop color space mapping Harry Wentland
2026-07-22 14:14   ` sashiko-bot
2026-07-28 16:01   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 08/11] drm/amd/display: Use GAMCOR for first TF if YUV conversion is needed Harry Wentland
2026-07-25  6:07   ` Alex Hung
2026-07-28 16:01   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 09/11] drm/amd/display: Check actual state during commit_tail Harry Wentland
2026-07-22 14:08   ` sashiko-bot
2026-07-28 16:02   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 10/11] drm/amd/display: Set color_space to plane_infos Harry Wentland
2026-07-22 14:13   ` sashiko-bot
2026-07-28 16:03   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 11/11] drm/amd/display: Force GAMCOR for subsampled surfaces with PQ/Gamma22/HLG Harry Wentland
2026-07-25  6:11   ` Alex Hung
2026-07-28 16:04   ` Robert Mader
2026-07-28 14:58 ` [PATCH v4 00/11] YUV conversion colorop with amdgpu and VKMS Robert Mader

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=20260730172758.0c65485f@fluorite \
    --to=pekka.paalanen@collabora.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=mwen@igalia.com \
    --cc=robert.mader@collabora.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.