All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: John Cox <jc@kynesim.co.uk>
Cc: linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl
Subject: Re: [PATCH 1/2] media: v4l: Add Broadcom sand formats to videodev2.h
Date: Fri, 10 Feb 2023 11:17:23 -0500	[thread overview]
Message-ID: <04dd55039d1c66d382dc9086500e5b8037ed6598.camel@ndufresne.ca> (raw)
In-Reply-To: <1ogauh5ro652so8vtc2fsgor5g3pj6ns3e@4ax.com>

Le jeudi 09 février 2023 à 19:06 +0000, John Cox a écrit :
> Hi
> 
> > Le vendredi 27 janvier 2023 à 15:34 +0000, John Cox a écrit :
> > > Add fourccs for Broadcom 8 and 10-bit packed 128 byte column formats to
> > > videodev2.h
> > > 
> > > Signed-off-by: John Cox <jc@kynesim.co.uk>
> > > ---
> > >  include/uapi/linux/videodev2.h | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> > > index 1befd181a4cc..a836322ae5d8 100644
> > > --- a/include/uapi/linux/videodev2.h
> > > +++ b/include/uapi/linux/videodev2.h
> > > @@ -656,6 +656,8 @@ struct v4l2_pix_format {
> > >  #define V4L2_PIX_FMT_P010_4L4 v4l2_fourcc('T', '0', '1', '0') /* 12  Y/CbCr 4:2:0 10-bit 4x4 macroblocks */
> > >  #define V4L2_PIX_FMT_NV12_8L128       v4l2_fourcc('A', 'T', '1', '2') /* Y/CbCr 4:2:0 8x128 tiles */
> > >  #define V4L2_PIX_FMT_NV12_10BE_8L128  v4l2_fourcc_be('A', 'X', '1', '2') /* Y/CbCr 4:2:0 10-bit 8x128 tiles */
> > > +#define V4L2_PIX_FMT_NV12_C128        v4l2_fourcc('C', 'N', '1', '2') /* Y/CbCr 4:2:0 128 byte columns */
> > > +#define V4L2_PIX_FMT_P030_C128        v4l2_fourcc('C', 'N', '3', '0') /* Y/CbCr 4:2:0 10-bit packed 128 byte columns */
> > >  
> > >  /* Tiled YUV formats, non contiguous planes */
> > >  #define V4L2_PIX_FMT_NV12MT  v4l2_fourcc('T', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 tiles */
> > 
> > I would expect updates to v4l2-common.c and v4l2-ioctl.c to be in the same
> > patch. And then the driver should be using the helpers there whenever possible.
> 
> Fair point - I'll fix that.
> 
> What is the correct .bpp for 3 10-bit pixels packed into 4 bytes in the
> v4l2_format_info?

Good question, maybe this can be done with the fractional bpp support. I must
admit, I didn't think about padded cases, I was handling 10bit fully packed over
5 bytes.

https://lore.kernel.org/linux-arm-kernel/20230103170058.810597-3-benjamin.gaignard@collabora.com/
My case ended working with:

 { .format = V4L2_PIX_FMT_NV12_10LE40_4L4, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv = 2 },

Question is what do we do about comp_planes, if we kind of fake it to be 2, then maybe this would work.

 { .format = V4L2_PIX_FMT_P030_C128, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 4, 8, 0, 0 }, .bpp_div = { 3, 3, 1, 1 }, .hdiv = 2, .vdiv = 2 },

For weird format, this is a bit of hacky, all we want is to get the right
stride, and the offset part is not used for mem_planes = 1 formats.

let me know,
Nicolas

> 
> Regards
> 
> John Cox


  reply	other threads:[~2023-02-10 16:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 15:34 [PATCH 0/2] media: v4l: Add Broadcom sand format to the list of V4L formats John Cox
2023-01-27 15:34 ` [PATCH 1/2] media: v4l: Add Broadcom sand formats to videodev2.h John Cox
2023-02-09 18:20   ` Nicolas Dufresne
2023-02-09 19:06     ` John Cox
2023-02-10 16:17       ` Nicolas Dufresne [this message]
2023-02-12 18:49         ` John Cox
2023-02-13 16:25           ` Nicolas Dufresne
2023-01-27 15:34 ` [PATCH 2/2] media: v4l: Add documentation for Broadcom sand formats John Cox
2023-02-09 18:21   ` Nicolas Dufresne
2023-02-09 18:54     ` John Cox
2023-02-09 19:22       ` Dave Stevenson
2023-02-10 14:50       ` Nicolas Dufresne
2023-02-09 17:56 ` [PATCH 0/2] media: v4l: Add Broadcom sand format to the list of V4L formats Nicolas Dufresne
2023-02-09 18:21   ` John Cox
2023-02-10 14:42     ` Nicolas Dufresne
2023-02-10 15:10       ` John Cox

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=04dd55039d1c66d382dc9086500e5b8037ed6598.camel@ndufresne.ca \
    --to=nicolas@ndufresne.ca \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jc@kynesim.co.uk \
    --cc=linux-media@vger.kernel.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 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.