[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180618145843.14631-15-paul.kocialkowski@bootlin.com>
Date: Mon, 18 Jun 2018 16:58:38 +0200
From: Paul Kocialkowski <paul.kocialkowski@...tlin.com>
To: linux-media@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Chen-Yu Tsai <wens@...e.org>,
Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
Marco Franchi <marco.franchi@....com>,
Icenowy Zheng <icenowy@...c.io>,
Hans Verkuil <hverkuil@...all.nl>,
Sylwester Nawrocki <s.nawrocki@...sung.com>,
Tom Saeger <tom.saeger@...cle.com>,
Smitha T Murthy <smitha.t@...sung.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Andrzej Hajda <a.hajda@...sung.com>,
Jonathan Corbet <corbet@....net>,
"David S . Miller" <davem@...emloft.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linus Walleij <linus.walleij@...aro.org>,
Randy Dunlap <rdunlap@...radead.org>,
Arnd Bergmann <arnd@...db.de>,
Stanimir Varbanov <stanimir.varbanov@...aro.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Ramesh Shanmugasundaram <ramesh.shanmugasundaram@...renesas.com>,
Jacob Chen <jacob-chen@...wrt.com>,
Steve Longerbeam <slongerbeam@...il.com>,
Todor Tomov <todor.tomov@...aro.org>,
Jacopo Mondi <jacopo+renesas@...ndi.org>,
Alexandre Courbot <acourbot@...omium.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Tomasz Figa <tfiga@...omium.org>,
Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>,
Hans de Goede <hdegoede@...hat.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-sunxi@...glegroups.com,
Hugues Fruchet <hugues.fruchet@...com>,
Randy Li <ayaka@...lik.info>
Subject: [PATCH v4 14/19] media: v4l: Add definition for Allwinner's MB32-tiled NV12 format
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@...tlin.com>
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).
+
+ 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 98961d5acb1a..c44d7134e8d5 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1294,6 +1294,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;
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 5e950a6f20df..cbbeeaec9710 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 */
--
2.17.0
Powered by blists - more mailing lists