linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
	Emma Anholt <emma@anholt.net>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 5/9] drm/vc4: hdmi: Rework the CSC matrices organization
Date: Thu, 26 Jan 2023 14:40:03 +0100	[thread overview]
Message-ID: <20230126134003.74z4iazwcsyl4et7@houat> (raw)
In-Reply-To: <CAPY8ntCsp_qbjeyYvUQ0jmKh8gecvR-NmYaEPkrsxBhyZrHPxg@mail.gmail.com>

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

Hi,

On Wed, Jan 11, 2023 at 05:00:41PM +0000, Dave Stevenson wrote:
> Hi Thomas
> 
> Thanks for the review
> 
> On Wed, 11 Jan 2023 at 15:03, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> >
> > Hi
> >
> > Am 07.12.22 um 17:07 schrieb Maxime Ripard:
> > > From: Dave Stevenson <dave.stevenson@raspberrypi.com>
> > >
> > > The CSC matrices were stored as separate matrix for each colorspace, and
> > > if we wanted a limited or full RGB output.
> > >
> > > This created some gaps in our support and we would not always pick the
> > > relevant matrix.
> > >
> > > Let's rework our data structure to store one per colorspace, and then a
> > > matrix for limited range and one for full range. This makes us add a new
> > > matrix to support full range BT709 YUV output, and drops the redundant
> > > (but somehow different) BT709 YUV444 vs YUV422 matrix.
> >
> > The final sentence is confusing and I didn't understand how two
> > different matrices can now be just one.
> 
> Two changes to accommodate the hardware requirements:
> 
> Firstly the driver was only defining
> vc5_hdmi_csc_full_rgb_to_limited_yuv444_bt709 and
> vc5_hdmi_csc_full_rgb_to_limited_yuv422_bt709. There was no matrix for
> full_rgb_to_full_yuv_bt709, so that had to be added.
> 
> Secondly, for some reason when in 444 mode the hardware wants the
> matrix rows in a different order. That is why
> vc5_hdmi_csc_full_rgb_to_limited_yuv444_bt709 differed from
> vc5_hdmi_csc_full_rgb_to_limited_yuv422_bt709 - it was a simple
> reordering of the rows.
> 
> This patch dropped the special handling for 444, and in the process
> programmed the wrong coefficients into the hardware :-(
> Patch 6/9 then reintroduces this reordering, so really should be
> squashed into the one patch.

Thanks to both of you for that feedback. I've chosen a slightly
different solution since I believe it still makes sens to have the swap
patch separate. I've move the swap function introduction earlier and
removed the two redundant matrices in that patch. And now, that patch
doesn't drop any matrix anymore so I've removed the confusing part of
the commit log.

> Looking at my more recent work, it looks like I messed up on 6/9 too.
> One of the patches on [1] corrects that row swapping for yuv444 - I
> was obviously having a bad day.
> 
> Maxime: Are you OK to fix that up?

I've squashed it in for the next revision

Thanks!
maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-01-26 13:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 16:07 [PATCH 0/9] drm/vc4: hdmi: Broadcast RGB, BT601, BT2020 Maxime Ripard
2022-12-07 16:07 ` [PATCH 1/9] drm/vc4: hdmi: Update all the planes if the TV margins are changed Maxime Ripard
2023-01-11 13:56   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 2/9] drm/vc4: hdmi: Constify container_of wrappers Maxime Ripard
2023-01-11 14:02   ` Thomas Zimmermann
2023-01-11 14:17     ` Jani Nikula
2022-12-07 16:07 ` [PATCH 3/9] drm/vc4: hdmi: Add Broadcast RGB property to allow override of RGB range Maxime Ripard
2023-01-11 14:11   ` Thomas Zimmermann
2023-01-26  9:38     ` Maxime Ripard
2022-12-07 16:07 ` [PATCH 4/9] drm/vc4: hdmi: Rename full range helper Maxime Ripard
2023-01-11 14:13   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 5/9] drm/vc4: hdmi: Rework the CSC matrices organization Maxime Ripard
2023-01-11 15:03   ` Thomas Zimmermann
2023-01-11 17:00     ` Dave Stevenson
2023-01-26 13:40       ` Maxime Ripard [this message]
2022-12-07 16:07 ` [PATCH 6/9] drm/vc4: hdmi: Swap CSC matrix channels for YUV444 Maxime Ripard
2023-01-11 15:05   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 7/9] drm/vc4: hdmi: Add a function to retrieve the CSC matrix Maxime Ripard
2023-01-11 15:14   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 8/9] drm/vc4: hdmi: Add BT.601 Support Maxime Ripard
2023-01-11 15:16   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 9/9] drm/vc4: hdmi: Add BT.2020 Support Maxime Ripard
2023-01-11 15:18   ` Thomas Zimmermann

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=20230126134003.74z4iazwcsyl4et7@houat \
    --to=maxime@cerno.tech \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).