AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <pekka.paalanen@collabora.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	Melissa Wen <mwen@igalia.com>
Subject: Re: [PATCH v3 01/11] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX
Date: Fri, 24 Jul 2026 12:54:29 +0300	[thread overview]
Message-ID: <20260724125429.5bf43ae5@fluorite> (raw)
In-Reply-To: <c4aaa599-d1d8-4418-ada7-2e141f7a9e3f@amd.com>

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

On Tue, 21 Jul 2026 15:27:55 -0400
Harry Wentland <harry.wentland@amd.com> wrote:

> On 2026-07-03 06:52, Pekka Paalanen wrote:
> > On Tue, 23 Jun 2026 12:48:02 -0400
> > Harry Wentland <harry.wentland@amd.com> 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.
> >>
> >> v2:
> >>  - Naming changes (Pekka)
> >>
> >> v3:
> >>  - Fix NC matrix enum name and string (Melissa)
> >>  - Rebase
> >>
> >> Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
> >> Reviewed-by: Melissa Wen <mwen@igalia.com>
> >> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> >> ---
> >>  drivers/gpu/drm/drm_atomic.c      |   4 ++
> >>  drivers/gpu/drm/drm_atomic_uapi.c |   4 ++
> >>  drivers/gpu/drm/drm_colorop.c     | 106 ++++++++++++++++++++++++++++++
> >>  include/drm/drm_colorop.h         |  84 +++++++++++++++++++++++
> >>  include/uapi/drm/drm_mode.h       |  12 ++++
> >>  5 files changed, 210 insertions(+)
> >>  
> > 
> > Hi,
> > 
> > the UAPI looks good.
> > 
> > Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
> > 
> > It's a little bit unfortunate that the colorop UAPI documentation is
> > embedded into kernel-private enum types' documentation.
> >   
> 
> Agreed. This goes beyond this patchset. I'll have a look at a separate
> series to see if we can fix that.
> 
> > Is RGB always full-range? The documentation could be more explicit
> > about that. Maybe the documentation should spell out the matrix
> > contents just to be clear? There are more than one form of limited
> > range IIRC (HDMI, JPEG, SDI). Or maybe JPEG was a different type of
> > full-range?
> >   
> 
> It's always full-range. Agreed about spelling out the matrix contents.
> 
> >> +	 * enum string "RGB709 to RGB2020"
> >> +	 *
> >> +	 * Selects the fixed-function CSC preset that converts RGB
> >> +	 * (BT.709) colorimetry to RGB (BT.2020).  
> > 
> > Why is this called a "CSC preset" rather than a matrix? This confuses
> > me.
> >   
> 
> Will fix that up.
> 
> I was taking Chaitanya's patch as-is and adding my changes in Patch 2
> but with all these changes I'll end up squashing the two commits
> together.
> 
> > Was there a conclusion from discussions around compatible pixel formats
> > for a specific choice of a fixed matrix? How will userspace discover
> > that, or will it be based on documentation and enforced as a common
> > requirement over all drivers?
> > 
> > ISTR some hardware requiring an YUV pixel format to be able to use the
> > YCbCr conversion matrices, or vice versa. Otherwise there is no reason
> > to have that limitation.
> >   
> 
> We talked about this at the Hackfest (offline most likely) and the
> consensus is that there's no reason to limit this to certain pixel formats.
> We should treat it as a simple matrix that operates on the 3 input channels.
> If userspace decides to select a CSC matrix for an RGB buffer it's assumed
> that that's intentional and userspace knows what it's doing.

Excellent!

Thanks, Harry!
-pq

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

  reply	other threads:[~2026-07-27  0:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 16:48 [PATCH v3 00/11] YUV conversion colorop with amdgpu and VKMS Harry Wentland
2026-06-23 16:48 ` [PATCH v3 01/11] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX Harry Wentland
2026-07-03 10:15   ` Robert Mader
2026-07-03 10:52   ` Pekka Paalanen
2026-07-21 19:27     ` Harry Wentland
2026-07-24  9:54       ` Pekka Paalanen [this message]
2026-06-23 16:48 ` [PATCH v3 02/11] drm/colorop: Add limited-range YUV-to-RGB fixed matrix enum values Harry Wentland
2026-07-03 10:17   ` Robert Mader
2026-06-23 16:48 ` [PATCH v3 03/11] drm/vkms: Add fixed matrix colorop to color pipeline Harry Wentland
2026-07-03 10:24   ` Robert Mader
2026-06-23 16:48 ` [PATCH v3 04/11] drm/vkms: Add atomic check and matrix handling for fixed matrix colorop Harry Wentland
2026-07-03 10:32   ` Robert Mader
2026-06-23 16:48 ` [PATCH v3 05/11] drm/amd/display: Add fixed matrix colorop to color pipeline Harry Wentland
2026-06-23 16:48 ` [PATCH v3 06/11] drm/amd/display: Implement fixed matrix colorop color space mapping Harry Wentland
2026-06-23 16:48 ` [PATCH v3 07/11] drm/amd/display: Use GAMCOR for first TF if YUV conversion is needed Harry Wentland
2026-06-23 16:48 ` [PATCH v3 08/11] drm/amd/display: Check actual state during commit_tail Harry Wentland
2026-06-23 16:48 ` [PATCH v3 09/11] drm/amd/display: Set color_space to plane_infos Harry Wentland
2026-06-23 16:48 ` [PATCH v3 10/11] drm/amd/display: Set COLOR_SPACE_SRGB when fixed matrix colorop is bypassed Harry Wentland
2026-07-03 10:40   ` Robert Mader
2026-07-14 15:38     ` Harry Wentland
2026-06-23 16:48 ` [PATCH v3 11/11] drm/amd/display: Force GAMCOR for subsampled surfaces with PQ/Gamma22/HLG Harry Wentland
2026-07-03  9:44 ` [PATCH v3 00/11] YUV conversion colorop with amdgpu and VKMS Robert Mader
2026-07-09 14:33 ` 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=20260724125429.5bf43ae5@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 \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox