public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Benjamin Gaignard <benjamin.gaignard@collabora.com>,
	 ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de,
	mchehab@kernel.org,  robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de,
	 hverkuil-cisco@xs4all.nl
Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	 devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org, kernel@collabora.com
Subject: Re: [PATCH v5 03/13] media: Add NV12_10LE40_4L4 pixel format
Date: Tue, 11 Apr 2023 11:07:43 -0400	[thread overview]
Message-ID: <2a39fb8f9fb658a12bda3779015e8cb2b976a965.camel@collabora.com> (raw)
In-Reply-To: <20230330154043.1250736-4-benjamin.gaignard@collabora.com>

Le jeudi 30 mars 2023 à 17:40 +0200, Benjamin Gaignard a écrit :
> NV12_10LE40_4L4 is the 10-bits per component version of
> NV12_4L4 pixel format.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
>  Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst | 4 ++++
>  drivers/media/v4l2-core/v4l2-common.c                       | 1 +
>  drivers/media/v4l2-core/v4l2-ioctl.c                        | 1 +
>  include/uapi/linux/videodev2.h                              | 1 +
>  4 files changed, 7 insertions(+)
> 
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
> index f1d5bb7b806d..8805213a75f8 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
> @@ -270,6 +270,7 @@ of the luma plane.
>  .. _V4L2-PIX-FMT-NV12MT:
>  .. _V4L2-PIX-FMT-NV12MT-16X16:
>  .. _V4L2-PIX-FMT-NV12-4L4:
> +.. _V4L2-PIX-FMT-NV12-10LE40-4L4:
>  .. _V4L2-PIX-FMT-NV12-16L16:
>  .. _V4L2-PIX-FMT-NV12-32L32:
>  .. _V4L2-PIX-FMT-NV12M-8L128:
> @@ -306,6 +307,9 @@ 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
>  identical.
>  
> +``V4L2_PIX_FMT_NV12_10LE40_4L4`` is similar to ``V4L2_PIX_FMT_NV12_4L4``
> +and stores 10 bits pixels in 4x4 tiles.

I think this is not enough, as it does not describe the NV12_10E40 pixel
packing. We don't have that as a linear format yet in V4L2 (unlike
DRM_FORMAT_NV15 on DRM side). So I'd suggest to drop the usual bit packing table
here for now. Please ping Sebastien Fricke, as he got that for (along with
NV12_10LE40 base format) documented in his RKVDEC HEVC decoder work.

> 
> +
>  ``V4L2_PIX_FMT_NV12_16L16`` stores pixels in 16x16 tiles, and stores
>  tiles linearly in memory. The line stride and image height must be
>  aligned to a multiple of 16. The layouts of the luma and chroma planes are
> diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
> index 9cb0895dea1c..7f46c45982d6 100644
> --- a/drivers/media/v4l2-core/v4l2-common.c
> +++ b/drivers/media/v4l2-core/v4l2-common.c
> @@ -278,6 +278,7 @@ const struct v4l2_format_info *v4l2_format_info(u32 format)
>  
>  		/* Tiled YUV formats */
>  		{ .format = V4L2_PIX_FMT_NV12_4L4, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 2 },
> +		{ .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 },

As you will be doing v6, can you initiallized the forgotten "block" parameters ?


>  		{ .format = V4L2_PIX_FMT_P010_4L4, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 2, 4, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 2 },
>  
>  		/* YUV planar formats, non contiguous variant */
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index d2b905ba5240..5a0c5b3a6b0f 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1351,6 +1351,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
>  	case V4L2_PIX_FMT_NV12_4L4:	descr = "Y/UV 4:2:0 (4x4 Linear)"; break;
>  	case V4L2_PIX_FMT_NV12_16L16:	descr = "Y/UV 4:2:0 (16x16 Linear)"; break;
>  	case V4L2_PIX_FMT_NV12_32L32:   descr = "Y/UV 4:2:0 (32x32 Linear)"; break;
> +	case V4L2_PIX_FMT_NV12_10LE40_4L4: descr = "10-bit YUV 4:2:0 (4x4 Linear)"; break;
>  	case V4L2_PIX_FMT_P010_4L4:	descr = "10-bit Y/UV 4:2:0 (4x4 Linear)"; break;
>  	case V4L2_PIX_FMT_NV12M:	descr = "Y/UV 4:2:0 (N-C)"; break;
>  	case V4L2_PIX_FMT_NV21M:	descr = "Y/VU 4:2:0 (N-C)"; break;
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 8cdc7967cdea..93e300111ca1 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -664,6 +664,7 @@ struct v4l2_pix_format {
>  #define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2')   /* 12  Y/CbCr 4:2:0  4x4 tiles */
>  #define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 16x16 tiles */
>  #define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2') /* 12  Y/CbCr 4:2:0 32x32 tiles */
> +#define V4L2_PIX_FMT_NV12_10LE40_4L4 v4l2_fourcc('V', 'T', '1', '5')
>  #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 */


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2023-04-11 15:08 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 15:40 [PATCH v5 00/13] AV1 stateless decoder for RK3588 Benjamin Gaignard
2023-03-30 15:40 ` [PATCH v5 01/13] dt-bindings: media: rockchip-vpu: Add rk3588 vpu compatible Benjamin Gaignard
2023-03-30 15:40 ` [PATCH v5 02/13] v4l2-common: Add support for fractional bpp Benjamin Gaignard
2023-03-30 15:40 ` [PATCH v5 03/13] media: Add NV12_10LE40_4L4 pixel format Benjamin Gaignard
2023-04-11 15:07   ` Nicolas Dufresne [this message]
2023-04-11 16:01     ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 04/13] media: verisilicon: Get bit depth for V4L2_PIX_FMT_NV12_10LE40_4L4 Benjamin Gaignard
2023-04-11 15:08   ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 05/13] media: verisilicon: Add AV1 decoder mode and controls Benjamin Gaignard
2023-03-30 15:40 ` [PATCH v5 06/13] media: verisilicon: Check AV1 bitstreams bit depth Benjamin Gaignard
2023-04-11 15:09   ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 07/13] media: verisilicon: Compute motion vectors size for AV1 frames Benjamin Gaignard
2023-04-11 15:10   ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 08/13] media: verisilicon: Add AV1 entropy helpers Benjamin Gaignard
2023-04-11 15:13   ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 09/13] media: verisilicon: Add Rockchip AV1 decoder Benjamin Gaignard
2023-04-11 12:33   ` Hans Verkuil
2023-04-11 13:39     ` Benjamin Gaignard
2023-04-11 15:15   ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 10/13] media: verisilicon: Add film grain feature to AV1 driver Benjamin Gaignard
2023-04-11 15:17   ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 11/13] media: verisilicon: Enable AV1 decoder on rk3588 Benjamin Gaignard
2023-04-11 15:18   ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 12/13] media: verisilicon: Conditionally ignore native formats Benjamin Gaignard
2023-04-11 15:25   ` Nicolas Dufresne
2023-03-30 15:40 ` [PATCH v5 13/13] media: AV1: Make sure that bit depth in correctly initialize Benjamin Gaignard
2023-04-11 15:26   ` Nicolas Dufresne

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=2a39fb8f9fb658a12bda3779015e8cb2b976a965.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=heiko@sntech.de \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@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