Thread (17 messages) read the whole thread 17 messages, 3 authors, 2023-07-13

Re: [PATCH 1/3] media: mediatek: vcodec: Add capture format to support 10bit tile mode

From: Yunfei Dong (董云飞) <Yunfei.Dong@mediatek.com>
Date: 2023-07-12 03:13:17
Also in: linux-devicetree, linux-media, linux-mediatek, lkml

Hi Nicolas,

Thanks for your suggestion.

On Tue, 2023-07-11 at 16:16 -0400, Nicolas Dufresne wrote:
 	 
External email : Please do not click links or open attachments until
you have verified the sender or the content.
 Le mardi 11 juillet 2023 à 20:57 +0800, Yunfei Dong a écrit :
quoted
From: Mingjia Zhang <redacted>

Define one uncompressed capture format V4L2_PIX_FMT_MT2110T in
order to
quoted
support 10bit for AV1/VP9/HEVC in mt8195.

Signed-off-by: Mingjia Zhang <redacted>
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
++++++++
quoted
 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
quoted
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.
quoted
 
         Decoder's implementation can be found here,
         `aspeed_codec <
https://github.com/AspeedTech-BMC/aspeed_codec/>`__
quoted
+    * .. _V4L2-PIX-FMT-MT2110T:
+
+      - ``V4L2_PIX_FMT_MT2110T``
+      - 'MT2110T'
+      - Two-planar 10-Bit tile mode YVU420 format used by Mediatek
MT8195, MT8188
quoted
+        and more. This format have similitude with
``V4L2_PIX_FMT_MM21``.
quoted
+        It remains an opaque intermediate format and it is used
for VP9, AV1
quoted
+        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
It's much better if you can provider the better doc to me.
Thanks you again.

Best Regards,
Yunfei Dong
quoted
 .. raw:: latex
 
     \normalsize
diff --git a/drivers/media/v4l2-core/v4l2-common.c
b/drivers/media/v4l2-core/v4l2-common.c
quoted
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)
quoted
 { .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 },
quoted
 { .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 },
quoted
 { .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 },
quoted
+{ .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,
quoted
+  .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 },
quoted
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
b/drivers/media/v4l2-core/v4l2-ioctl.c
quoted
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)
quoted
 case V4L2_PIX_FMT_QC10C:descr = "QCOM Compressed 10-bit Format";
break;
quoted
 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;
quoted
 default:
 if (fmt->description[0])
 return;
diff --git a/include/uapi/linux/videodev2.h
b/include/uapi/linux/videodev2.h
quoted
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 */
quoted
 #define V4L2_PIX_FMT_MT21C    v4l2_fourcc('M', 'T', '2', '1') /*
Mediatek compressed block mode  */
quoted
 #define V4L2_PIX_FMT_MM21     v4l2_fourcc('M', 'M', '2', '1') /*
Mediatek 8-bit block mode, two non-contiguous planes */
quoted
+#define V4L2_PIX_FMT_MT2110T  v4l2_fourcc('M', 'T', '2', 'T') /*
Mediatek 10-bit block tile mode */
quoted
 #define V4L2_PIX_FMT_INZI     v4l2_fourcc('I', 'N', 'Z', 'I') /*
Intel Planar Greyscale 10-bit and Depth 16-bit */
quoted
 #define V4L2_PIX_FMT_CNF4     v4l2_fourcc('C', 'N', 'F', '4') /*
Intel 4-bit packed depth confidence information */
quoted
 #define V4L2_PIX_FMT_HI240    v4l2_fourcc('H', 'I', '2', '4') /*
BTTV 8-bit dithered RGB */
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help