mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: kernel@collabora.com,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] docs: uapi: media: Document Mediatek 10bit tiled formats
Date: Fri,  4 Aug 2023 15:27:37 -0400	[thread overview]
Message-ID: <20230804192737.19016-6-nicolas.dufresne@collabora.com> (raw)
In-Reply-To: <20230804192737.19016-1-nicolas.dufresne@collabora.com>

Document V4L2_PIX_FMT_MT2110T and V4L2_PIX_FMT_MT2110R. These two
formats are nearly identical, reusing MM21 format and expending it
by inserting chunk of 16 bytes of lower 2 bit pixel data after each
chunk of 64 bytes higher 8 bit of data.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
 .../media/v4l/pixfmt-reserved.rst             |  13 --
 .../media/v4l/pixfmt-yuv-planar.rst           | 122 ++++++++++++++++++
 2 files changed, 122 insertions(+), 13 deletions(-)

diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
index 296ad2025e8d..58f6ae25b2e7 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
@@ -275,19 +275,6 @@ please make a proposal on the linux-media mailing list.
 
         Decoder's implementation can be found here,
         `aspeed_codec <https://github.com/AspeedTech-BMC/aspeed_codec/>`__
-    * .. _V4L2-PIX-FMT-MT2110T:
-
-      - ``V4L2_PIX_FMT_MT2110T``
-      - 'MT2110T'
-      - This format is two-planar 10-Bit tile mode and having similitude with
-        ``V4L2_PIX_FMT_MM21`` in term of alignment and tiling. Used for VP9, AV1
-        and HEVC.
-    * .. _V4L2-PIX-FMT-MT2110R:
-
-      - ``V4L2_PIX_FMT_MT2110R``
-      - 'MT2110R'
-      - This format is two-planar 10-Bit raster mode and having similitude with
-        ``V4L2_PIX_FMT_MM21`` in term of alignment and tiling. Used for AVC.
 .. raw:: latex
 
     \normalsize
diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
index 052927bd9396..6ef5cd6bd9e2 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
@@ -144,6 +144,20 @@ All components are stored with the same number of bits per component.
       - Cb, Cr
       - Yes
       - 4x4 tiles
+    * - V4L2_PIX_FMT_MT2110T
+      - 'MT2T'
+      - 15
+      - 4:2:0
+      - Cb, Cr
+      - No
+      - 16x32 / 16x16 tiles tiled low bits
+    * - V4L2_PIX_FMT_MT2110R
+      - 'MT2R'
+      - 15
+      - 4:2:0
+      - Cb, Cr
+      - No
+      - 16x32 / 16x16 tiles raster low bits
     * - V4L2_PIX_FMT_NV16
       - 'NV16'
       - 8
@@ -369,6 +383,8 @@ two non-contiguous planes.
 .. _V4L2-PIX-FMT-NV15-4L4:
 .. _V4L2-PIX-FMT-NV12M-10BE-8L128:
 .. _V4L2-PIX-FMT-NV12-10BE-8L128:
+.. _V4L2-PIX-FMT-MT2110T:
+.. _V4L2-PIX-FMT-MT2110R:
 
 Tiled NV15
 ----------
@@ -453,6 +469,112 @@ it means that the low bits and high bits of one pixel may be in different tiles.
 ``V4L2_PIX_FMT_NV12_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_10BE_8L128`` but stores
 two planes in one memory.
 
+``V4L2_PIX_FMT_MT2110T``` is one of Mediatek packed 10bit YUV 4:2:0 formats.
+It is fully packed 10bit 4:2:0 format like NV15 (15 bits per pixel), except
+that the lower two bits data is stored in separate partitions. The format is
+composed of 16x32 luma tiles, and 16x16 chroma tiles. Each tiles have 640
+bytes separate in 8 partitions of 80 bytes each. The first 64 bytes represents
+the 8 most significant bits of pixel data. The remaining 16 bytes contains the
+2 least significant of pixel data.
+
+.. kernel-figure:: mt2110t.svg
+    :alt:    mt2110t.svg
+    :align:  center
+
+    Layout of Example MT2110T Chroma Tile
+
+Filtering out the lower part of each partitions results in a valid
+``V4L2_PIX_FMT_MM21`` frame. A partition is a sub-tile of size 16 x 4. The
+lower two bits is said to be tiled since each bytes contains the lower two
+bits of the column of for pixel matching the same index. The chroma tiles
+only have 4 partitions.
+
+.. flat-table:: MT2110T LSB bits layout
+    :header-rows:  1
+    :stub-columns: 0
+
+    * -
+      - start + 0
+      - start + 1
+      - . . .
+      - start\ +\ 15
+    * - bits 0:2
+      - Y'\ :sub:`0:0`
+      - Y'\ :sub:`0:1`
+      - . . .
+      - Y'\ :sub:`0:15`
+    * - bits 2:3
+      - Y'\ :sub:`1:0`
+      - Y'\ :sub:`1:1`
+      - . . .
+      - Y'\ :sub:`1:15`
+    * - bits 4:5
+      - Y'\ :sub:`2:0`
+      - Y'\ :sub:`2:1`
+      - . . .
+      - Y'\ :sub:`2:15`
+    * - bits 6:7
+      - Y'\ :sub:`3:0`
+      - Y'\ :sub:`3:1`
+      - . . .
+      - Y'\ :sub:`3:15`
+
+``V4L2_PIX_FMT_MT2110R`` is identical to ``V4L2_PIX_FMT_MT2110T`` except that
+the least significant two bits layout is in raster order. This means the first byte
+contains 4 pixels of the first row, with 4 bytes per line.
+
+.. flat-table:: MT2110R LSB bits layout
+    :header-rows:  1
+    :stub-columns: 0
+
+    * -
+      - b0
+      -
+      -
+      -
+      - ...
+      - b3
+    * - start + 0
+      - Y'\ :sub:`0:0`
+      - Y'\ :sub:`0:1`
+      - Y'\ :sub:`0:2`
+      - Y'\ :sub:`0:3`
+      - ...
+      - Y'\ :sub:`0:12`
+      - Y'\ :sub:`0:13`
+      - Y'\ :sub:`0:14`
+      - Y'\ :sub:`0:15`
+    * - start + 4
+      - Y'\ :sub:`1:0`
+      - Y'\ :sub:`1:1`
+      - Y'\ :sub:`1:2`
+      - Y'\ :sub:`1:3`
+      - ...
+      - Y'\ :sub:`1:12`
+      - Y'\ :sub:`1:13`
+      - Y'\ :sub:`1:14`
+      - Y'\ :sub:`1:15`
+    * - start + 8
+      - Y'\ :sub:`2:0`
+      - Y'\ :sub:`2:1`
+      - Y'\ :sub:`2:2`
+      - Y'\ :sub:`2:3`
+      - ...
+      - Y'\ :sub:`2:12`
+      - Y'\ :sub:`2:13`
+      - Y'\ :sub:`2:14`
+      - Y'\ :sub:`2:15`
+    * - start\ +\ 12
+      - Y'\ :sub:`3:0`
+      - Y'\ :sub:`3:1`
+      - Y'\ :sub:`3:2`
+      - Y'\ :sub:`3:3`
+      - ...
+      - Y'\ :sub:`3:12`
+      - Y'\ :sub:`3:13`
+      - Y'\ :sub:`3:14`
+      - Y'\ :sub:`3:15`
+
 
 .. _V4L2-PIX-FMT-NV16:
 .. _V4L2-PIX-FMT-NV61:
-- 
2.40.1


  parent reply	other threads:[~2023-08-04 19:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230804192737.19016-1-nicolas.dufresne@collabora.com>
2023-08-04 19:27 ` [PATCH 1/5] docs: uapi: media: Properly locate NV12MT diagram Nicolas Dufresne
2023-08-07 11:22   ` Andrzej Pietrasiewicz
2023-08-04 19:27 ` [PATCH 2/5] docs: uapi: media: Move NV12_10BE_8L128 to NV15 section Nicolas Dufresne
2023-08-07 11:28   ` Andrzej Pietrasiewicz
2023-08-04 19:27 ` [PATCH 3/5] docs: uapi: media: Add common documentation of tiled NV15 Nicolas Dufresne
2023-08-07 11:37   ` Andrzej Pietrasiewicz
2023-09-13 18:11     ` Nicolas Dufresne
2023-08-04 19:27 ` [PATCH 4/5] docs: uapi: media: Add a layout diagram for MT2110T Nicolas Dufresne
2023-08-07 18:40   ` Andrzej Pietrasiewicz
2023-08-07 19:29     ` Nicolas Dufresne
2023-08-07 21:24       ` Nicolas Dufresne
2023-08-08 11:46       ` Andrzej Pietrasiewicz
2023-08-04 19:27 ` Nicolas Dufresne [this message]
2023-08-07 18:35   ` [PATCH 5/5] docs: uapi: media: Document Mediatek 10bit tiled formats Andrzej Pietrasiewicz

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=20230804192737.19016-6-nicolas.dufresne@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®