public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paulk@sys-base.io>
To: Nicolas Dufresne <nicolas@ndufresne.ca>
Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Hans Verkuil <hans@jjverkuil.nl>,
	Jernej Skrabec <jernej.skrabec@siol.net>
Subject: Re: [PATCH] media: cedrus: Add support for additional output formats
Date: Mon, 30 Jun 2025 22:33:05 +0200	[thread overview]
Message-ID: <aGL0gVwHb8eJvCEu@collins> (raw)
In-Reply-To: <82be6ca4c33d394fc52fbe2a90362fa6955d0a47.camel@ndufresne.ca>

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

Hi Nicolas,

Le Mon 30 Jun 25, 15:16, Nicolas Dufresne a écrit :
> 
> Hi Paul, Jernej,
> 
> Le vendredi 23 mai 2025 à 17:43 +0200, Paul Kocialkowski a écrit :
> > From: Jernej Skrabec <jernej.skrabec@siol.net>
> > 
> > If VPU supports untiled output, it actually supports several different
> > YUV 4:2:0 layouts, namely NV12, NV21, YUV420 and YVU420.
> > 
> > Add support for all of them.
> > 
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> > Reviewed-by: Paul Kocialkowski <paulk@sys-base.io>
> > ---
> > 
> > Looks like this patch never made it, sorry about that.
> > I've rebased it atop media/next and added my Reviewed-by tag.
> > ---
> >  drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 18 +++++++++++++++++-
> >  .../staging/media/sunxi/cedrus/cedrus_video.c  | 18 ++++++++++++++++++
> >  2 files changed, 35 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> > b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> > index 32af0e96e762..168d89c5a16d 100644
> > --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> > @@ -86,9 +86,25 @@ void cedrus_dst_format_set(struct cedrus_dev *dev,
> >  
> >  	switch (fmt->pixelformat) {
> >  	case V4L2_PIX_FMT_NV12:
> > +	case V4L2_PIX_FMT_NV21:
> > +	case V4L2_PIX_FMT_YUV420:
> > +	case V4L2_PIX_FMT_YVU420:
> >  		chroma_size = ALIGN(width, 16) * ALIGN(height, 16) / 2;
> >  
> > -		reg = VE_PRIMARY_OUT_FMT_NV12;
> > +		switch (fmt->pixelformat) {
> > +		case V4L2_PIX_FMT_NV12:
> > +			reg = VE_PRIMARY_OUT_FMT_NV12;
> > +			break;
> > +		case V4L2_PIX_FMT_NV21:
> > +			reg = VE_PRIMARY_OUT_FMT_NV21;
> > +			break;
> > +		case V4L2_PIX_FMT_YUV420:
> > +			reg = VE_PRIMARY_OUT_FMT_YU12;
> > +			break;
> > +		case V4L2_PIX_FMT_YVU420:
> 
> Just so its recorded, Hans added a default: case here while applying.

Thanks for the notification! I would maybe have selected NV12 instead but
I guess it doesn't really matter all that much since there should be layers
of checking before this is reached.

All the best,

Paul

> regards,
> Nicolas
> 
> > +			reg = VE_PRIMARY_OUT_FMT_YV12;
> > +			break;
> > +		}
> >  		cedrus_write(dev, VE_PRIMARY_OUT_FMT, reg);
> >  
> >  		reg = chroma_size / 2;
> > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> > b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> > index 77f78266f406..9fae2c7493d0 100644
> > --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> > @@ -64,6 +64,21 @@ static struct cedrus_format cedrus_formats[] = {
> >  		.pixelformat	= V4L2_PIX_FMT_NV12_32L32,
> >  		.directions	= CEDRUS_DECODE_DST,
> >  	},
> > +	{
> > +		.pixelformat	= V4L2_PIX_FMT_NV21,
> > +		.directions	= CEDRUS_DECODE_DST,
> > +		.capabilities	= CEDRUS_CAPABILITY_UNTILED,
> > +	},
> > +	{
> > +		.pixelformat	= V4L2_PIX_FMT_YUV420,
> > +		.directions	= CEDRUS_DECODE_DST,
> > +		.capabilities	= CEDRUS_CAPABILITY_UNTILED,
> > +	},
> > +	{
> > +		.pixelformat	= V4L2_PIX_FMT_YVU420,
> > +		.directions	= CEDRUS_DECODE_DST,
> > +		.capabilities	= CEDRUS_CAPABILITY_UNTILED,
> > +	},
> >  };
> >  
> >  #define CEDRUS_FORMATS_COUNT	ARRAY_SIZE(cedrus_formats)
> > @@ -140,6 +155,9 @@ void cedrus_prepare_format(struct v4l2_pix_format
> > *pix_fmt)
> >  		break;
> >  
> >  	case V4L2_PIX_FMT_NV12:
> > +	case V4L2_PIX_FMT_NV21:
> > +	case V4L2_PIX_FMT_YUV420:
> > +	case V4L2_PIX_FMT_YVU420:
> >  		/* 16-aligned stride. */
> >  		bytesperline = ALIGN(width, 16);
> >  



-- 
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.

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

  reply	other threads:[~2025-06-30 20:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23 15:43 [PATCH] media: cedrus: Add support for additional output formats Paul Kocialkowski
2025-06-30 19:16 ` Nicolas Dufresne
2025-06-30 20:33   ` Paul Kocialkowski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-05-20 17:14 Jernej Skrabec
2020-06-06  5:40 ` Ezequiel Garcia

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=aGL0gVwHb8eJvCEu@collins \
    --to=paulk@sys-base.io \
    --cc=hans@jjverkuil.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=jernej.skrabec@siol.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=samuel@sholland.org \
    --cc=wens@csie.org \
    /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