From: paul.kocialkowski@bootlin.com (Paul Kocialkowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 2/8] media: v4l: Add definition for Allwinner's MB32-tiled NV12 format
Date: Tue, 07 Aug 2018 18:40:15 +0200 [thread overview]
Message-ID: <2f2f5721ab5b07e36ec920b9d9c7fa0839b99a95.camel@bootlin.com> (raw)
In-Reply-To: <4628cfe1-e42f-67ad-20b3-078c6a96d6ed@xs4all.nl>
Hi,
On Sat, 2018-08-04 at 13:42 +0200, Hans Verkuil wrote:
> On 07/25/2018 12:02 PM, Paul Kocialkowski wrote:
> > This introduces support for Allwinner's MB32-tiled NV12 format, where
> > each plane is divided into macroblocks of 32x32 pixels. Hence, the size
> > of each plane has to be aligned to 32 bytes. The pixels inside each
> > macroblock are coded as they would be if the macroblock was a single
> > plane, line after line.
> >
> > The MB32-tiled NV12 format is used by the video engine on Allwinner
> > platforms: it is the default format for decoded frames (and the only one
> > available in the oldest supported platforms).
> >
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> > ---
> > Documentation/media/uapi/v4l/pixfmt-reserved.rst | 15 ++++++++++++++-
> > drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
> > include/uapi/linux/videodev2.h | 1 +
> > 3 files changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > index 38af1472a4b4..9a68b6a787bf 100644
> > --- a/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > +++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > @@ -243,7 +243,20 @@ please make a proposal on the linux-media mailing list.
> > It is an opaque intermediate format and the MDP hardware must be
> > used to convert ``V4L2_PIX_FMT_MT21C`` to ``V4L2_PIX_FMT_NV12M``,
> > ``V4L2_PIX_FMT_YUV420M`` or ``V4L2_PIX_FMT_YVU420``.
> > -
> > + * .. _V4L2-PIX-FMT-MB32-NV12:
> > +
> > + - ``V4L2_PIX_FMT_MB32_NV12``
> > + - 'MN12'
> > + - Two-planar NV12-based format used by the Allwinner video engine
> > + hardware, with 32x32 tiles for the luminance plane and 32x64 tiles
> > + for the chrominance plane. Each tile is a linear pixel data
> > + representation within its own bounds. Each tile follows the previous
> > + one linearly (as in, from left to right, top to bottom).
>
> as in, -> as in:
Thanks!
> > +
> > + The frame dimensions are aligned to match an integer number of
> > + tiles, resulting in 32-aligned resolutions for the luminance plane
> > + and 16-aligned resolutions for the chrominance plane (with 2x2
> > + subsampling).
> >
> > .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
> >
> > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> > index 68e914b83a03..7e1c200de10d 100644
> > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > @@ -1331,6 +1331,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
> > case V4L2_PIX_FMT_SE401: descr = "GSPCA SE401"; break;
> > case V4L2_PIX_FMT_S5C_UYVY_JPG: descr = "S5C73MX interleaved UYVY/JPEG"; break;
> > case V4L2_PIX_FMT_MT21C: descr = "Mediatek Compressed Format"; break;
> > + case V4L2_PIX_FMT_MB32_NV12: descr = "Allwinner tiled NV12 format"; break;
>
> "Allwinner Tiled NV12 Format"
>
> If it is Allwinner specific, then that should be in the PIX_FMT name as well:
> something like V4L2_PIX_FMT_ALLWINNER_MB32_NV12 or perhaps SUNXI_MB32_NV12.
>
> On the other hand, you could also see this as a variant of e.g. V4L2_PIX_FMT_NV12MT
> or V4L2_PIX_FMT_NV12MT_16X16. In that case it is not necessarily Allwinner specific
> since other devices might choose this format. You can go either way, as long
> as it is consistent.
I think it is fair to say that the format is Allwinner-specific and
unlikely to be found elsewhere. It is not actually very well described
by "MB32" since the chroma tiles have a different pixel size than the
luma tiles (16x64).
It would probably be clearer to just call the format:
V4L2_PIX_FMT_SUNXI_TILED_NV12
Cheers,
Paul
> > default:
> > WARN(1, "Unknown pixelformat 0x%08x\n", fmt->pixelformat);
> > if (fmt->description[0])
> > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> > index d171361ed9b3..453d27142e31 100644
> > --- a/include/uapi/linux/videodev2.h
> > +++ b/include/uapi/linux/videodev2.h
> > @@ -670,6 +670,7 @@ struct v4l2_pix_format {
> > #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
> > #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */
> > #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */
> > +#define V4L2_PIX_FMT_MB32_NV12 v4l2_fourcc('M', 'N', '1', '2') /* Allwinner tiled NV12 format */
> >
> > /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */
> > #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */
> >
>
> Regards,
>
> Hans
--
Paul Kocialkowski, Bootlin (formerly Free Electrons)
Embedded Linux and kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180807/04eae2c7/attachment.sig>
next prev parent reply other threads:[~2018-08-07 16:40 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 10:02 [PATCH v6 0/8] Cedrus driver for the Allwinner Video Engine, using media requests Paul Kocialkowski
2018-07-25 10:02 ` [PATCH v6 1/8] media: v4l: Add definitions for MPEG2 slice format and metadata Paul Kocialkowski
2018-08-04 11:35 ` Hans Verkuil
2018-08-08 11:57 ` Paul Kocialkowski
2018-08-04 13:30 ` Hans Verkuil
2018-08-08 12:05 ` Paul Kocialkowski
2018-07-25 10:02 ` [PATCH v6 2/8] media: v4l: Add definition for Allwinner's MB32-tiled NV12 format Paul Kocialkowski
2018-08-04 11:42 ` Hans Verkuil
2018-08-07 16:40 ` Paul Kocialkowski [this message]
2018-07-25 10:02 ` [PATCH v6 3/8] dt-bindings: media: Document bindings for the Cedrus VPU driver Paul Kocialkowski
2018-07-25 10:02 ` [PATCH v6 4/8] media: platform: Add Cedrus VPU decoder driver Paul Kocialkowski
2018-07-27 14:03 ` [linux-sunxi] " Jernej Škrabec
2018-07-27 14:58 ` Jernej Škrabec
2018-08-07 12:31 ` Paul Kocialkowski
2018-08-07 15:05 ` Jernej Škrabec
2018-08-07 15:10 ` Tomasz Figa
2018-08-07 12:16 ` Paul Kocialkowski
2018-07-29 7:58 ` Jernej Škrabec
2018-08-07 12:07 ` Paul Kocialkowski
2018-08-03 20:49 ` Ezequiel Garcia
2018-08-06 14:21 ` Paul Kocialkowski
2018-08-08 9:28 ` Paul Kocialkowski
2018-08-04 12:18 ` Hans Verkuil
2018-08-06 13:50 ` Paul Kocialkowski
2018-08-06 14:10 ` Tomasz Figa
2018-08-07 7:19 ` Paul Kocialkowski
2018-08-08 3:16 ` Tomasz Figa
2018-07-25 10:02 ` [PATCH v6 5/8] ARM: dts: sun5i: Add Video Engine and reserved memory nodes Paul Kocialkowski
2018-07-25 10:02 ` [PATCH v6 6/8] ARM: dts: sun7i-a20: " Paul Kocialkowski
2018-07-25 10:02 ` [PATCH v6 7/8] ARM: dts: sun8i-a33: " Paul Kocialkowski
2018-07-25 10:02 ` [PATCH v6 8/8] ARM: dts: sun8i-h3: " Paul Kocialkowski
2018-08-04 12:43 ` [PATCH v6 0/8] Cedrus driver for the Allwinner Video Engine, using media requests Hans Verkuil
2018-08-06 9:22 ` Paul Kocialkowski
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=2f2f5721ab5b07e36ec920b9d9c7fa0839b99a95.camel@bootlin.com \
--to=paul.kocialkowski@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).