devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: "Yunfei Dong" <yunfei.dong@mediatek.com>,
	"Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
	"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
	"Nathan Hebert" <nhebert@chromium.org>
Cc: Chen-Yu Tsai <wenst@chromium.org>,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	Fritz Koenig <frkoenig@chromium.org>,
	Daniel Vetter <daniel@ffwll.ch>,
	Steve Cho <stevecho@chromium.org>,
	Mingjia Zhang <mingjia.zhang@mediatek.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Project_Global_Chrome_Upstream_Group@mediatek.com
Subject: Re: [PATCH 1/3] media: mediatek: vcodec: Add capture format to support 10bit tile mode
Date: Tue, 11 Jul 2023 16:16:11 -0400	[thread overview]
Message-ID: <c68c63924a2aed6c98818d3ad3b39e065cbd0b15.camel@collabora.com> (raw)
In-Reply-To: <20230711125749.15555-2-yunfei.dong@mediatek.com>

Le mardi 11 juillet 2023 à 20:57 +0800, Yunfei Dong a écrit :
> From: Mingjia Zhang <mingjia.zhang@mediatek.com>
> 
> Define one uncompressed capture format V4L2_PIX_FMT_MT2110T in order to
> support 10bit for AV1/VP9/HEVC in mt8195.
> 
> Signed-off-by: Mingjia Zhang <mingjia.zhang@mediatek.com>
> Co-developed-by: Yunfei Dong <yunfei.dong@mediatek.com>
> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> ---
>  Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 8 ++++++++
>  drivers/media/v4l2-core/v4l2-common.c                     | 2 ++
>  drivers/media/v4l2-core/v4l2-ioctl.c                      | 1 +
>  include/uapi/linux/videodev2.h                            | 1 +
>  4 files changed, 12 insertions(+)
> 
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
> index 58f6ae25b2e7..b16a7257580c 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
> @@ -275,6 +275,14 @@ 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'
> +      - Two-planar 10-Bit tile mode YVU420 format used by Mediatek MT8195, MT8188
> +        and more. This format have similitude with ``V4L2_PIX_FMT_MM21``.
> +        It remains an opaque intermediate format and it is used for VP9, AV1
> +        and HEVC.

Documenting uncompressed video formats as "opaque" is always last resort in
V4L2. There is no justification here since this format is already implemented in
software and pending in GStreamer (so its well understood format). I will try
and provide some better doc for you to include.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3444

>  .. raw:: latex
>  
>      \normalsize
> diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
> index bee1535b04d3..869fc09a210b 100644
> --- a/drivers/media/v4l2-core/v4l2-common.c
> +++ b/drivers/media/v4l2-core/v4l2-common.c
> @@ -262,6 +262,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 format)
>  		{ .format = V4L2_PIX_FMT_VYUY,    .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 1 },
>  		{ .format = V4L2_PIX_FMT_Y212,    .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 1 },
>  		{ .format = V4L2_PIX_FMT_YUV48_12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 6, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 },
> +		{ .format = V4L2_PIX_FMT_MT2110T, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv = 2,
> +		  .block_w = { 16, 8, 0, 0 }, .block_h = { 32, 16, 0, 0 }},
>  
>  		/* YUV planar formats */
>  		{ .format = V4L2_PIX_FMT_NV12,    .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 },
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 01ba27f2ef87..f465c0e3d6e3 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1508,6 +1508,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
>  		case V4L2_PIX_FMT_QC10C:	descr = "QCOM Compressed 10-bit Format"; break;
>  		case V4L2_PIX_FMT_AJPG:		descr = "Aspeed JPEG"; break;
>  		case V4L2_PIX_FMT_AV1_FRAME:	descr = "AV1 Frame"; break;
> +		case V4L2_PIX_FMT_MT2110T:	descr = "Mediatek 10bit Tile Mode"; break;
>  		default:
>  			if (fmt->description[0])
>  				return;
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 3af6a82d0cad..8c7d71afbdc7 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -796,6 +796,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_MM21     v4l2_fourcc('M', 'M', '2', '1') /* Mediatek 8-bit block mode, two non-contiguous planes */
> +#define V4L2_PIX_FMT_MT2110T  v4l2_fourcc('M', 'T', '2', 'T') /* Mediatek 10-bit block tile 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_CNF4     v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */
>  #define V4L2_PIX_FMT_HI240    v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */


  reply	other threads:[~2023-07-11 20:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 12:57 [PATCH 0/3] media: mediatek: vcodec: Add driver to support 10bit Yunfei Dong
2023-07-11 12:57 ` [PATCH 1/3] media: mediatek: vcodec: Add capture format to support 10bit tile mode Yunfei Dong
2023-07-11 20:16   ` Nicolas Dufresne [this message]
2023-07-12  3:12     ` Yunfei Dong (董云飞)
2023-07-11 12:57 ` [PATCH 2/3] media: mediatek: vcodec: Add capture format to support 10bit raster mode Yunfei Dong
2023-07-11 12:57 ` [PATCH 3/3] media: mediatek: vcodec: Add driver to support 10bit Yunfei Dong
2023-07-11 16:53   ` Nicolas Dufresne
2023-07-12  3:32     ` Yunfei Dong (董云飞)
2023-07-11 20:12   ` Nicolas Dufresne
2023-07-12  3:02     ` Yunfei Dong (董云飞)
2023-07-11 19:15 ` [PATCH 0/3] " Nicolas Dufresne
2023-07-11 19:39   ` Nicolas Dufresne
2023-07-11 19:40   ` Nícolas F. R. A. Prado
2023-07-11 20:10     ` Nicolas Dufresne
2023-07-12  3:11   ` Yunfei Dong (董云飞)
2023-07-13 13:31     ` Nicolas Dufresne
2023-07-11 20:05 ` 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=c68c63924a2aed6c98818d3ad3b39e065cbd0b15.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=frkoenig@chromium.org \
    --cc=hsinyi@chromium.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mingjia.zhang@mediatek.com \
    --cc=nfraprado@collabora.com \
    --cc=nhebert@chromium.org \
    --cc=stevecho@chromium.org \
    --cc=wenst@chromium.org \
    --cc=yunfei.dong@mediatek.com \
    /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).