From patchwork Thu Sep 14 15:06:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 13385593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB9B3EEAA4E for ; Thu, 14 Sep 2023 15:07:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236000AbjINPHm (ORCPT ); Thu, 14 Sep 2023 11:07:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240687AbjINPHl (ORCPT ); Thu, 14 Sep 2023 11:07:41 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5225A8; Thu, 14 Sep 2023 08:07:37 -0700 (PDT) Received: from whitebuilder.lan (unknown [IPv6:2606:6d00:15:bae9::c73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madras.collabora.co.uk (Postfix) with ESMTPSA id D31A86607346; Thu, 14 Sep 2023 16:07:35 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694704056; bh=fY/r2diqs96P/mQNHqPsnegumIKHR6/vp+KeaEc/UlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ak5YGKItlPbrHeTfF9OJXFwSYn4rVT4A0E92UyKlbUsmPG+Nrd8m9ADYb4SK0LNoa RMU5QHZEX4td+ryGnWep6IloB3MJ0pOp9ARP1W5ObVKyvRQCwFZi0k52V4ZX7bclz7 k6MC9CUnmslgqaitY6nAWTadO8jsJ+EnvZYrLtqIfvCyoQ+8ICKehdlQH/UfYkdC6r eMPLJ1NO7cOzvnjCqQxXP4ZSbFFOO1NqhbPDh/1UyzAt2XMGVkMc6incSfQ4QsRO7s Coy34QNbpzKv5UrygzoVLP/WWVnED8OQXfrkb/gSpx4LLzRLo+fVGlD0HYH2yQ3JP5 HBbxbm2nnD1YQ== From: Nicolas Dufresne To: Mauro Carvalho Chehab Cc: kernel@collabora.com, Nicolas Dufresne , linux-media@vger.kernel.org, Andrzej Pietrasiewicz , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] docs: uapi: media: Properly locate NV12MT diagram Date: Thu, 14 Sep 2023 11:06:47 -0400 Message-Id: <20230914150651.3114134-2-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> References: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The diagram have been pushed back at the end of a list of unrelated pixels formats. Move it back next its related pixel format. Signed-off-by: Nicolas Dufresne Reviewed-by: Andrzej Pietrasiewicz --- .../media/v4l/pixfmt-yuv-planar.rst | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst index 1840224faa412..fb826923ff1d6 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst @@ -322,6 +322,22 @@ If the vertical resolution is an odd number of tiles, the last row of tiles is stored in linear order. The layouts of the luma and chroma planes are identical. +.. _nv12mt: + +.. kernel-figure:: nv12mt.svg + :alt: nv12mt.svg + :align: center + + V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout + +.. _nv12mt_ex: + +.. kernel-figure:: nv12mt_example.svg + :alt: nv12mt_example.svg + :align: center + + Example V4L2_PIX_FMT_NV12MT memory layout of tiles + ``V4L2_PIX_FMT_NV12_4L4`` stores pixels in 4x4 tiles, and stores tiles linearly in memory. The line stride and image height must be aligned to a multiple of 4. The layouts of the luma and chroma planes are @@ -369,22 +385,6 @@ image height must be aligned to a multiple of 32. The number of luma and chroma tiles are identical, even though the tile size differ. The image is formed of two non-contiguous planes. -.. _nv12mt: - -.. kernel-figure:: nv12mt.svg - :alt: nv12mt.svg - :align: center - - V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout - -.. _nv12mt_ex: - -.. kernel-figure:: nv12mt_example.svg - :alt: nv12mt_example.svg - :align: center - - Example V4L2_PIX_FMT_NV12MT memory layout of tiles - .. _V4L2-PIX-FMT-NV15-4L4: Tiled NV15 From patchwork Thu Sep 14 15:06:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 13385594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 115E3EEAA4E for ; Thu, 14 Sep 2023 15:07:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240735AbjINPHs (ORCPT ); Thu, 14 Sep 2023 11:07:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240748AbjINPHp (ORCPT ); Thu, 14 Sep 2023 11:07:45 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9131C1FDC; Thu, 14 Sep 2023 08:07:41 -0700 (PDT) Received: from whitebuilder.lan (unknown [IPv6:2606:6d00:15:bae9::c73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madras.collabora.co.uk (Postfix) with ESMTPSA id 86F33660734A; Thu, 14 Sep 2023 16:07:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694704060; bh=BPugKkNBgf1YBf9yRnKNsGKQzDLc0irbpk9bgkgeaHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aYvz0UsyRSgAzXnKQNmj8etXWDX28i+xdHMyhlv77lQBOuYgt1QJtiJ47HBEtBluU /revLxhv5nzbUlK3JCmor28S6M63lPwrschrn2LoxjF6Bh/AR04g/tGrvX5VDHbtQG 8BorSdRlj7+t0sppDo7z9A812PVdTIHCSxxDIH/AEpyzBKsA4/6Oqo8OFSglNO/m9X 4cXthznYHQ14Bhvi3wNZTmL4QFT8qzOPk49jFf2k3YdT2QyJamgjE/V2qOPj7wmh6c ObTRNqGr6yMaztL+lEpOGOsgrmG8IUMkdLzigHBLVxoGV/EkXoTmVcg81R8W+PooRs waquA3//hmcgQ== From: Nicolas Dufresne To: Mauro Carvalho Chehab Cc: kernel@collabora.com, Nicolas Dufresne , linux-media@vger.kernel.org, Andrzej Pietrasiewicz , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] docs: uapi: media: Move NV12_10BE_8L128 to NV15 section Date: Thu, 14 Sep 2023 11:06:48 -0400 Message-Id: <20230914150651.3114134-3-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> References: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This is a 15 bits per pixel (or packed 10 bit format), so move it into the relevant section. Signed-off-by: Nicolas Dufresne Reviewed-by: Andrzej Pietrasiewicz --- .../media/v4l/pixfmt-yuv-planar.rst | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst index fb826923ff1d6..1d43532095c07 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst @@ -295,8 +295,6 @@ of the luma plane. .. _V4L2-PIX-FMT-NV12-32L32: .. _V4L2-PIX-FMT-NV12M-8L128: .. _V4L2-PIX-FMT-NV12-8L128: -.. _V4L2-PIX-FMT-NV12M-10BE-8L128: -.. _V4L2-PIX-FMT-NV12-10BE-8L128: .. _V4L2-PIX-FMT-MM21: Tiled NV12 @@ -361,6 +359,25 @@ The layouts of the luma and chroma planes are identical. ``V4L2_PIX_FMT_NV12_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_8L128`` but stores two planes in one memory. +``V4L2_PIX_FMT_MM21`` store luma pixel in 16x32 tiles, and chroma pixels +in 16x16 tiles. The line stride must be aligned to a multiple of 16 and the +image height must be aligned to a multiple of 32. The number of luma and chroma +tiles are identical, even though the tile size differ. The image is formed of +two non-contiguous planes. + + +.. _V4L2-PIX-FMT-NV15-4L4: +.. _V4L2-PIX-FMT-NV12M-10BE-8L128: +.. _V4L2-PIX-FMT-NV12-10BE-8L128: + +Tiled NV15 +---------- + +``V4L2_PIX_FMT_NV15_4L4`` Semi-planar 10-bit YUV 4:2:0 formats, using 4x4 tiling. +All components are packed without any padding between each other. +As a side-effect, each group of 4 components are stored over 5 bytes +(YYYY or UVUV = 4 * 10 bits = 40 bits = 5 bytes). + ``V4L2_PIX_FMT_NV12M_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores 10 bits pixels in 2D 8x128 tiles, and stores tiles linearly in memory. the data is arranged in big endian order. @@ -379,21 +396,6 @@ byte 4: Y3(bits 7-0) ``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_MM21`` store luma pixel in 16x32 tiles, and chroma pixels -in 16x16 tiles. The line stride must be aligned to a multiple of 16 and the -image height must be aligned to a multiple of 32. The number of luma and chroma -tiles are identical, even though the tile size differ. The image is formed of -two non-contiguous planes. - -.. _V4L2-PIX-FMT-NV15-4L4: - -Tiled NV15 ----------- - -Semi-planar 10-bit YUV 4:2:0 formats, using 4x4 tiling. -All components are packed without any padding between each other. -As a side-effect, each group of 4 components are stored over 5 bytes -(YYYY or UVUV = 4 * 10 bits = 40 bits = 5 bytes). .. _V4L2-PIX-FMT-NV16: .. _V4L2-PIX-FMT-NV61: From patchwork Thu Sep 14 15:06:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 13385595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98480EEAA53 for ; Thu, 14 Sep 2023 15:07:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240753AbjINPHs (ORCPT ); Thu, 14 Sep 2023 11:07:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240760AbjINPHr (ORCPT ); Thu, 14 Sep 2023 11:07:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0072E1AE; Thu, 14 Sep 2023 08:07:42 -0700 (PDT) Received: from whitebuilder.lan (unknown [IPv6:2606:6d00:15:bae9::c73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madras.collabora.co.uk (Postfix) with ESMTPSA id 4B9916607346; Thu, 14 Sep 2023 16:07:41 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694704061; bh=Z1TdW3UGd+wLMJ7r5K88qHk1ygH+lB8tB04DHSYcEAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fez6uwEM/0+sbgrGWw24hDtX7QRinNJs7rz8YHNRjsccYwp+fGOoCxBEG6LhBWYJa miJU8QfvFEJVZ+J4EaVdJhKw8FEtfgss3SW7vsMvY1LmgYSmbRgA/z6C/lc1/m79qA MeLJ58m2VccgSys5dMZiGmycx82jHpuiw5+nB/VFXeEaqED29n6hpY9BThUeF1/M8p atRmUdprKV9eFdZ6k5bJ0WuymIaSbsKfCBKQPNEh9kMpTXo812nXq9oLdDSuJOcnsE TVms6Qm0TurM7tmTjydLX0h/BrTBSyb/Vd0LKDC7Y7XxXF7MFkuYSG3/BMUz1TKFgA ofc5KILqWYUTQ== From: Nicolas Dufresne To: Mauro Carvalho Chehab Cc: kernel@collabora.com, Nicolas Dufresne , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] docs: uapi: media: Add common documentation of tiled NV15 Date: Thu, 14 Sep 2023 11:06:49 -0400 Message-Id: <20230914150651.3114134-4-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> References: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This way we don't have to repeat over and over how the pixels are packed in NV15. Signed-off-by: Nicolas Dufresne --- .../media/v4l/pixfmt-yuv-planar.rst | 144 ++++++++++++++++-- 1 file changed, 131 insertions(+), 13 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst index 1d43532095c07..2f0e0c97870b2 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst @@ -373,25 +373,143 @@ two non-contiguous planes. Tiled NV15 ---------- -``V4L2_PIX_FMT_NV15_4L4`` Semi-planar 10-bit YUV 4:2:0 formats, using 4x4 tiling. -All components are packed without any padding between each other. -As a side-effect, each group of 4 components are stored over 5 bytes -(YYYY or UVUV = 4 * 10 bits = 40 bits = 5 bytes). +Semi-planar 10-bit YUV 4:2:0 formats. All components are packed +without any padding between each other. Each components group occupy 15 +bits and are usually stored in group of 4 components stored over 5 bytes +(YYYY or UVUV = 4 * 10 bits = 40 bits = 5 bytes) or partitioned into +upper 8 bit and lower 2 bits. The final arrangement will vary depending if +the hardware operated in little or big endian. + +.. flat-table:: Little endian sample of 4 NV15 luma pixels + :header-rows: 1 + :stub-columns: 1 + + * - Bit + - 7 + - 6 + - 5 + - 4 + - 3 + - 2 + - 1 + - 0 + * - Byte 0 + - Y'\ :sub:`0:7` + - Y'\ :sub:`0:6` + - Y'\ :sub:`0:5` + - Y'\ :sub:`0:4` + - Y'\ :sub:`0:3` + - Y'\ :sub:`0:2` + - Y'\ :sub:`0:1` + - Y'\ :sub:`0:0` + * - Byte 1 + - Y'\ :sub:`1:5` + - Y'\ :sub:`1:4` + - Y'\ :sub:`1:3` + - Y'\ :sub:`1:2` + - Y'\ :sub:`1:1` + - Y'\ :sub:`1:0` + - Y'\ :sub:`0:9` + - Y'\ :sub:`0:8` + * - Byte 2 + - Y'\ :sub:`2:3` + - Y'\ :sub:`2:2` + - Y'\ :sub:`2:1` + - Y'\ :sub:`2:0` + - Y'\ :sub:`1:9` + - Y'\ :sub:`1:8` + - Y'\ :sub:`1:7` + - Y'\ :sub:`1:6` + * - Byte 3 + - Y'\ :sub:`3:1` + - Y'\ :sub:`3:0` + - Y'\ :sub:`2:9` + - Y'\ :sub:`2:8` + - Y'\ :sub:`2:7` + - Y'\ :sub:`2:6` + - Y'\ :sub:`2:5` + - Y'\ :sub:`2:4` + * - Byte 4 + - Y'\ :sub:`3:9` + - Y'\ :sub:`3:8` + - Y'\ :sub:`3:7` + - Y'\ :sub:`3:6` + - Y'\ :sub:`3:5` + - Y'\ :sub:`3:4` + - Y'\ :sub:`3:3` + - Y'\ :sub:`3:2` + +.. flat-table:: Big endian sample of 4 NV15 luma pixels + :header-rows: 1 + :stub-columns: 1 + + * - Bit + - 7 + - 6 + - 5 + - 4 + - 3 + - 2 + - 1 + - 0 + * - Byte 0 + - Y'\ :sub:`0:9` + - Y'\ :sub:`0:8` + - Y'\ :sub:`0:7` + - Y'\ :sub:`0:6` + - Y'\ :sub:`0:5` + - Y'\ :sub:`0:4` + - Y'\ :sub:`0:3` + - Y'\ :sub:`0:2` + * - Byte 1 + - Y'\ :sub:`0:1` + - Y'\ :sub:`0:0` + - Y'\ :sub:`1:9` + - Y'\ :sub:`1:8` + - Y'\ :sub:`1:7` + - Y'\ :sub:`1:6` + - Y'\ :sub:`1:5` + - Y'\ :sub:`1:4` + * - Byte 2 + - Y'\ :sub:`1:3` + - Y'\ :sub:`1:2` + - Y'\ :sub:`1:1` + - Y'\ :sub:`1:0` + - Y'\ :sub:`2:9` + - Y'\ :sub:`2:8` + - Y'\ :sub:`2:7` + - Y'\ :sub:`2:6` + * - Byte 3 + - Y'\ :sub:`2:5` + - Y'\ :sub:`2:4` + - Y'\ :sub:`2:3` + - Y'\ :sub:`2:2` + - Y'\ :sub:`2:1` + - Y'\ :sub:`2:0` + - Y'\ :sub:`3:9` + - Y'\ :sub:`3:8` + * - Byte 4 + - Y'\ :sub:`3:7` + - Y'\ :sub:`3:6` + - Y'\ :sub:`3:5` + - Y'\ :sub:`3:4` + - Y'\ :sub:`3:3` + - Y'\ :sub:`3:2` + - Y'\ :sub:`3:1` + - Y'\ :sub:`3:0` + +``V4L2_PIX_FMT_NV15_4L4`` stores pixels in 4x4 tiles, and stores tiles linearly +in memory. The tiles contains little endian NV15 data. ``V4L2_PIX_FMT_NV12M_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores 10 bits pixels in 2D 8x128 tiles, and stores tiles linearly in memory. the data is arranged in big endian order. + The image height must be aligned to a multiple of 128. The layouts of the luma and chroma planes are identical. -Note the tile size is 8bytes multiplied by 128 bytes, -it means that the low bits and high bits of one pixel may be in different tiles. -The 10 bit pixels are packed, so 5 bytes contain 4 10-bit pixels layout like -this (for luma): -byte 0: Y0(bits 9-2) -byte 1: Y0(bits 1-0) Y1(bits 9-4) -byte 2: Y1(bits 3-0) Y2(bits 9-6) -byte 3: Y2(bits 5-0) Y3(bits 9-8) -byte 4: Y3(bits 7-0) +Note the tile size is 8 bytes multiplied by 128 bytes, +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. From patchwork Thu Sep 14 15:06:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 13385596 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 843EAEEAA54 for ; Thu, 14 Sep 2023 15:07:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240767AbjINPHu (ORCPT ); Thu, 14 Sep 2023 11:07:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240773AbjINPHt (ORCPT ); Thu, 14 Sep 2023 11:07:49 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 048B01FD6; Thu, 14 Sep 2023 08:07:45 -0700 (PDT) Received: from whitebuilder.lan (unknown [IPv6:2606:6d00:15:bae9::c73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madras.collabora.co.uk (Postfix) with ESMTPSA id E9C0C6607350; Thu, 14 Sep 2023 16:07:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694704063; bh=ao8j2hY/uvVAqc5YQyFLCkHMxnhVgdPAHv9piTh+AIo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dPcmlqspShRimTuaAmdWP35ky3YjpecPZ/7y/YygwkBVp+aeUGyETNF5p3pueKU8d cmeoiezyk0zHch0rIIWHI1sFT6+JhB3CDJaRcFXKQbBB2yW58aK+82TIFK0sG+Bd+O c4D9l0wbjsQpFfKQRJ+/Mi21qtnztgOr4QaBHQTNY+b3A4PywxiMlytFysy93S1Hux AL8LG+ZnUt4/MBB+fEA5SBjv0wGvPeR6IusblRS7jEOq66yUn2rOAV1OkzseoGzBcR nsWItmJpl+Sa2tok+ZgtdwSdu0KX+oMVYQrLoykYFdKsvj5lXj5UIVngLv7vAUNUrJ GB0elrVOBiQNg== From: Nicolas Dufresne To: Mauro Carvalho Chehab , Matthias Brugger , AngeloGioacchino Del Regno Cc: kernel@collabora.com, Nicolas Dufresne , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 4/5] docs: uapi: media: Add a layout diagram for MT2110T Date: Thu, 14 Sep 2023 11:06:50 -0400 Message-Id: <20230914150651.3114134-5-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> References: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This diagram details the partitioning done in each tiles. Signed-off-by: Nicolas Dufresne --- .../userspace-api/media/v4l/mt2110t.svg | 315 ++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 Documentation/userspace-api/media/v4l/mt2110t.svg diff --git a/Documentation/userspace-api/media/v4l/mt2110t.svg b/Documentation/userspace-api/media/v4l/mt2110t.svg new file mode 100644 index 0000000000000..a6e82f2c73dff --- /dev/null +++ b/Documentation/userspace-api/media/v4l/mt2110t.svg @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 16 px + + + + + + + + + + + 32 px + + + + + + + + 4 rows of upper 8 bits + + + + + + + 4 rows of lower 2bits + + + + + + + + + + + + + + + + + + + + 16 bytes + + + + + + + + 4 rows of upper 8 bits + + + + + + + 4 rows of lower 2 bits + + + + + + + + + + + + + + + 4 rows of upper 8 bits + + + + + + + 4 rows of lower 2 bits + + + + + + + + + + + + + + + 4 rows of upper 8 bits + + + + + + + 4 rows of lower 2 bits + + + + + + + + + + + + + + + 4 rows of upper 8 bits + + + + + + + 4 rows of lower 2 bits + + + + + + + + + + + + + + + 4 rows of upper 8 bits + + + + + + + 4 rows of lower 2 bits + + + + + + + + + + + + + + + 4 rows of upper 8 bits + + + + + + + 4 rows of lower 2 bits + + + + + + + + + + + + + + + 4 rows of upper 8 bits + + + + + + + 4 rows of lower 2 bits + + + + + + + + + + + + + + + + + + + + 64 bytes + + + + + + + + From patchwork Thu Sep 14 15:06:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 13385597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C052EEAA4F for ; Thu, 14 Sep 2023 15:07:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240876AbjINPIB (ORCPT ); Thu, 14 Sep 2023 11:08:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240773AbjINPH5 (ORCPT ); Thu, 14 Sep 2023 11:07:57 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E43A1FC2; Thu, 14 Sep 2023 08:07:47 -0700 (PDT) Received: from whitebuilder.lan (unknown [IPv6:2606:6d00:15:bae9::c73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madras.collabora.co.uk (Postfix) with ESMTPSA id 91CFF6607346; Thu, 14 Sep 2023 16:07:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694704066; bh=BJuuCTccNm1wBpGqGQgbWiAbPnhCietftX460WOqvPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cnsYCWbf3pb1Gpp1Vxj5TDJOdfpaZC4yAUDTBm740nba91i/CYena1dpS4uYjA+mn MZceFljVTGR0RLT+94d7ruPsQaiF/q08r6kP8FX2XkVr9DlB7bM0fMtg2OSLef+z7i IGPlwgVXg0WOFot/QduWvs9TvhDKKjleZmo1XG8r2pjHNEg1h6u+j1buBYFaRQP520 bapyYSfKYFOpioCV660wApIcB9qcuFKQSgKWgRSv3Z/TCt7Dv+GD093kL6TvtfSmnB v3qw7k7KlYzQzsYNtZLhI+bI2cGbqHTrfvjNLxaKKA4zBW5zWHlLw13dtUvqUXnO76 TQycxNNBvnvYQ== From: Nicolas Dufresne To: Mauro Carvalho Chehab Cc: kernel@collabora.com, Nicolas Dufresne , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] docs: uapi: media: Document Mediatek 10bit tiled formats Date: Thu, 14 Sep 2023 11:06:51 -0400 Message-Id: <20230914150651.3114134-6-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> References: <20230914150651.3114134-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- .../media/v4l/pixfmt-reserved.rst | 13 -- .../media/v4l/pixfmt-yuv-planar.rst | 129 ++++++++++++++++++ 2 files changed, 129 insertions(+), 13 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst index 296ad2025e8d3..58f6ae25b2e7d 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 `__ - * .. _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 2f0e0c97870b2..e37fe1d6cf166 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 ---------- @@ -514,6 +530,119 @@ 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 is 640 bytes +long, divided into 8 partitions of 80 bytes. The first 16 bytes of the +partition represent the 2 least significant bits of pixel data. The remaining +64 bytes represent the 8 most significant bits of pixel data. + +.. kernel-figure:: mt2110t.svg + :alt: mt2110t.svg + :align: center + + Layout of MT2110T Chroma Tile + +Filtering out the upper 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: 1 + + * - + - start + 0: + - start + 1: + - . . . + - start\ +\ 15: + * - Bits 1:0 + - Y'\ :sub:`0:0` + - Y'\ :sub:`0:1` + - . . . + - Y'\ :sub:`0:15` + * - Bit 3:2 + - Y'\ :sub:`1:0` + - Y'\ :sub:`1:1` + - . . . + - Y'\ :sub:`1:15` + * - Bits 5:4 + - Y'\ :sub:`2:0` + - Y'\ :sub:`2:1` + - . . . + - Y'\ :sub:`2:15` + * - Bits 7:6 + - 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: 2 + :stub-columns: 1 + + * - + - :cspan:`3` Byte 0 + - ... + - :cspan:`3` Byte 3 + * - + - 7:6 + - 5:4 + - 3:2 + - 1:0 + - ... + - 7:6 + - 5:4 + - 3:2 + - 1:0 + * - start + 0: + - Y'\ :sub:`0:3` + - Y'\ :sub:`0:2` + - Y'\ :sub:`0:1` + - Y'\ :sub:`0:0` + - ... + - Y'\ :sub:`0:15` + - Y'\ :sub:`0:14` + - Y'\ :sub:`0:13` + - Y'\ :sub:`0:12` + * - start + 4: + - Y'\ :sub:`1:3` + - Y'\ :sub:`1:2` + - Y'\ :sub:`1:1` + - Y'\ :sub:`1:0` + - ... + - Y'\ :sub:`1:15` + - Y'\ :sub:`1:14` + - Y'\ :sub:`1:13` + - Y'\ :sub:`1:12` + * - start + 8: + - Y'\ :sub:`2:3` + - Y'\ :sub:`2:2` + - Y'\ :sub:`2:1` + - Y'\ :sub:`2:0` + - ... + - Y'\ :sub:`2:15` + - Y'\ :sub:`2:14` + - Y'\ :sub:`2:13` + - Y'\ :sub:`2:12` + * - start\ +\ 12: + - Y'\ :sub:`3:3` + - Y'\ :sub:`3:2` + - Y'\ :sub:`3:1` + - Y'\ :sub:`3:0` + - ... + - Y'\ :sub:`3:15` + - Y'\ :sub:`3:14` + - Y'\ :sub:`3:13` + - Y'\ :sub:`3:12` + .. _V4L2-PIX-FMT-NV16: .. _V4L2-PIX-FMT-NV61: