From: Yunfei Dong <[email protected]>
Define two capture formats V4L2_PIX_FMT_MT2110R and
V4L2_PIX_FMT_MT2110T to support 10bit in mt8195, mt8199 and more.
Getting the size of each plane again when user space set 10bit
syntax to driver.
V4L2_PIX_FMT_MT2110R is used for H264, and V4L2_PIX_FMT_MT2110T
is used for AV1/VP9/HEVC.
patch 1 Add driver to support 10bit
patch 2 Add capture format V4L2_PIX_FMT_MT2110T to support 10bit tile mode
patch 3 Add capture format V4L2_PIX_FMT_MT2110R to support 10bit raster mode
---
- compared with v1:
- Fix set non sps return -EINVAL issue.
- Driver test pass in mt8195/mt8188 with tast and Youtube.
- Run v4l2 compliance in mt8195/mt8188 pass.
- fluster test as below:
- h264: (JVT-FR-EXT: 29/69 JVT-AVC_V1: 95/135)
- h265: (JCT-VC-HEVC_V1: 142/147)
- vp9 : (VP9-TEST-VECTORS: 1/6 VP9-TEST-VECTORS: 276/305)
- av1 : (CHROMIUM-10bit-AV1-TEST-VECTORS: 22/23 CHROMIUM-8bit-AV1-TEST-VECTORS: 11/13
- AV1-TEST-VECTORS: Ran 237/239)
- send the first version v1:
- Run 10bit VP9/AV1 fluster test pass.
- Will return error when the 10bit parameter no correctly in function mtk_vdec_s_ctrl.
---
Reference series:
[1]: this series depends on v6 which is send by Yunfei Dong.
message-id: [email protected]
Mingjia Zhang (3):
media: mediatek: vcodec: Add capture format to support 10bit tile mode
media: mediatek: vcodec: Add capture format to support 10bit raster
mode
media: mediatek: vcodec: Add driver to support 10bit
.../media/v4l/pixfmt-reserved.rst | 13 ++
.../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 22 ++-
.../vcodec/decoder/mtk_vcodec_dec_drv.h | 5 +
.../vcodec/decoder/mtk_vcodec_dec_stateless.c | 144 +++++++++++++++++-
drivers/media/v4l2-core/v4l2-common.c | 4 +
drivers/media/v4l2-core/v4l2-ioctl.c | 2 +
include/uapi/linux/videodev2.h | 2 +
7 files changed, 188 insertions(+), 4 deletions(-)
--
2.18.0
From: Mingjia Zhang <[email protected]>
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 <[email protected]>
Co-developed-by: Yunfei Dong <[email protected]>
Signed-off-by: Yunfei Dong <[email protected]>
---
Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 7 +++++++
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, 11 insertions(+)
diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
index 58f6ae25b2e7..0bc69639baaa 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
@@ -275,6 +275,13 @@ 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.
.. 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 */
--
2.18.0
From: Mingjia Zhang <[email protected]>
Define one uncompressed capture format V4L2_PIX_FMT_MT2110R in order to
support 10bit for H264 in mt8195.
Signed-off-by: Mingjia Zhang <[email protected]>
Co-developed-by: Yunfei Dong <[email protected]>
Signed-off-by: Yunfei Dong <[email protected]>
---
Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 6 ++++++
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, 10 insertions(+)
diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
index 0bc69639baaa..296ad2025e8d 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst
@@ -282,6 +282,12 @@ please make a proposal on the linux-media mailing list.
- 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/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
index 869fc09a210b..3a4b15a98e02 100644
--- a/drivers/media/v4l2-core/v4l2-common.c
+++ b/drivers/media/v4l2-core/v4l2-common.c
@@ -264,6 +264,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 format)
{ .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 }},
+ { .format = V4L2_PIX_FMT_MT2110R, .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 f465c0e3d6e3..f4d9d6279094 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1509,6 +1509,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
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;
+ case V4L2_PIX_FMT_MT2110R: descr = "Mediatek 10bit Raster Mode"; break;
default:
if (fmt->description[0])
return;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 8c7d71afbdc7..78260e5d9985 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -797,6 +797,7 @@ struct v4l2_pix_format {
#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_MT2110R v4l2_fourcc('M', 'T', '2', 'R') /* Mediatek 10-bit block raster 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 */
--
2.18.0
Hi Yunfei.
Le samedi 22 juillet 2023 à 15:44 +0800, Yunfei Dong a écrit :
> From: Yunfei Dong <[email protected]>
>
> Define two capture formats V4L2_PIX_FMT_MT2110R and
> V4L2_PIX_FMT_MT2110T to support 10bit in mt8195, mt8199 and more.
> Getting the size of each plane again when user space set 10bit
> syntax to driver.
>
> V4L2_PIX_FMT_MT2110R is used for H264, and V4L2_PIX_FMT_MT2110T
> is used for AV1/VP9/HEVC.
>
> patch 1 Add driver to support 10bit
> patch 2 Add capture format V4L2_PIX_FMT_MT2110T to support 10bit tile mode
> patch 3 Add capture format V4L2_PIX_FMT_MT2110R to support 10bit raster mode
> ---
> - compared with v1:
> - Fix set non sps return -EINVAL issue.
> - Driver test pass in mt8195/mt8188 with tast and Youtube.
> - Run v4l2 compliance in mt8195/mt8188 pass.
> - fluster test as below:
> - h264: (JVT-FR-EXT: 29/69 JVT-AVC_V1: 95/135)
> - h265: (JCT-VC-HEVC_V1: 142/147)
> - vp9 : (VP9-TEST-VECTORS: 1/6 VP9-TEST-VECTORS: 276/305)
> - av1 : (CHROMIUM-10bit-AV1-TEST-VECTORS: 22/23 CHROMIUM-8bit-AV1-TEST-VECTORS: 11/13
> - AV1-TEST-VECTORS: Ran 237/239)
Thanks for the fluster reports, I cannot confirm this yet, since it does not
apply. Note that you have forgot to provide V4L2 compliance report as requested.
>
> - send the first version v1:
> - Run 10bit VP9/AV1 fluster test pass.
> - Will return error when the 10bit parameter no correctly in function mtk_vdec_s_ctrl.
> ---
>
> Reference series:
> [1]: this series depends on v6 which is send by Yunfei Dong.
> message-id: [email protected]
>
> Mingjia Zhang (3):
> media: mediatek: vcodec: Add capture format to support 10bit tile mode
> media: mediatek: vcodec: Add capture format to support 10bit raster
> mode
> media: mediatek: vcodec: Add driver to support 10bit
>
> .../media/v4l/pixfmt-reserved.rst | 13 ++
> .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 22 ++-
> .../vcodec/decoder/mtk_vcodec_dec_drv.h | 5 +
> .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 144 +++++++++++++++++-
vcodec/decoder directory no longer exists. Can you rebase your work please ?
Nicolas
> drivers/media/v4l2-core/v4l2-common.c | 4 +
> drivers/media/v4l2-core/v4l2-ioctl.c | 2 +
> include/uapi/linux/videodev2.h | 2 +
> 7 files changed, 188 insertions(+), 4 deletions(-)
>
Hi Nicolas,
Thanks for your review.
On Mon, 2023-07-24 at 15:53 -0400, Nicolas Dufresne wrote:
> Hi Yunfei.
>
> Le samedi 22 juillet 2023 à 15:44 +0800, Yunfei Dong a écrit :
> > From: Yunfei Dong <[email protected]>
> >
> > Define two capture formats V4L2_PIX_FMT_MT2110R and
> > V4L2_PIX_FMT_MT2110T to support 10bit in mt8195, mt8199 and more.
> > Getting the size of each plane again when user space set 10bit
> > syntax to driver.
> >
> > V4L2_PIX_FMT_MT2110R is used for H264, and V4L2_PIX_FMT_MT2110T
> > is used for AV1/VP9/HEVC.
> >
> > patch 1 Add driver to support 10bit
> > patch 2 Add capture format V4L2_PIX_FMT_MT2110T to support 10bit
> > tile mode
> > patch 3 Add capture format V4L2_PIX_FMT_MT2110R to support 10bit
> > raster mode
> > ---
> > - compared with v1:
> > - Fix set non sps return -EINVAL issue.
> > - Driver test pass in mt8195/mt8188 with tast and Youtube.
> > - Run v4l2 compliance in mt8195/mt8188 pass.
> > - fluster test as below:
> > - h264: (JVT-FR-EXT: 29/69 JVT-AVC_V1: 95/135)
> > - h265: (JCT-VC-HEVC_V1: 142/147)
> > - vp9 : (VP9-TEST-VECTORS: 1/6 VP9-TEST-VECTORS: 276/305)
> > - av1 : (CHROMIUM-10bit-AV1-TEST-VECTORS: 22/23 CHROMIUM-8bit-
> > AV1-TEST-VECTORS: 11/13
> > - AV1-TEST-VECTORS: Ran 237/239)
>
> Thanks for the fluster reports, I cannot confirm this yet, since it
> does not
> apply. Note that you have forgot to provide V4L2 compliance report as
> requested.
>
I will add the compliance reulst in patch v3. The compliance result is
pass.
> >
> > - send the first version v1:
> > - Run 10bit VP9/AV1 fluster test pass.
> > - Will return error when the 10bit parameter no correctly in
> > function mtk_vdec_s_ctrl.
> > ---
> >
> > Reference series:
> > [1]: this series depends on v6 which is send by Yunfei Dong.
> > message-id: [email protected]
> >
> > Mingjia Zhang (3):
> > media: mediatek: vcodec: Add capture format to support 10bit tile
> > mode
> > media: mediatek: vcodec: Add capture format to support 10bit
> > raster
> > mode
> > media: mediatek: vcodec: Add driver to support 10bit
> >
> > .../media/v4l/pixfmt-reserved.rst | 13 ++
> > .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 22 ++-
> > .../vcodec/decoder/mtk_vcodec_dec_drv.h | 5 +
> > .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 144
> > +++++++++++++++++-
>
> vcodec/decoder directory no longer exists. Can you rebase your work
> please ?
>
This patch series is based on patch 'separate encoder and decoder'.
vcodec/decoder folder is added in that patch.
> Nicolas
>
Best Regards,
Yunfei Dong
> > drivers/media/v4l2-core/v4l2-common.c | 4 +
> > drivers/media/v4l2-core/v4l2-ioctl.c | 2 +
> > include/uapi/linux/videodev2.h | 2 +
> > 7 files changed, 188 insertions(+), 4 deletions(-)
> >
>
>
Hi Nicolas,
Thanks for your review.
On Mon, 2023-07-24 at 15:53 -0400, Nicolas Dufresne wrote:
> Hi Yunfei.
>
> Le samedi 22 juillet 2023 à 15:44 +0800, Yunfei Dong a écrit :
> > From: Yunfei Dong <[email protected]>
> >
> > Define two capture formats V4L2_PIX_FMT_MT2110R and
> > V4L2_PIX_FMT_MT2110T to support 10bit in mt8195, mt8199 and more.
> > Getting the size of each plane again when user space set 10bit
> > syntax to driver.
> >
> > V4L2_PIX_FMT_MT2110R is used for H264, and V4L2_PIX_FMT_MT2110T
> > is used for AV1/VP9/HEVC.
> >
> > patch 1 Add driver to support 10bit
> > patch 2 Add capture format V4L2_PIX_FMT_MT2110T to support 10bit
> > tile mode
> > patch 3 Add capture format V4L2_PIX_FMT_MT2110R to support 10bit
> > raster mode
> > ---
> > - compared with v1:
> > - Fix set non sps return -EINVAL issue.
> > - Driver test pass in mt8195/mt8188 with tast and Youtube.
> > - Run v4l2 compliance in mt8195/mt8188 pass.
> > - fluster test as below:
> > - h264: (JVT-FR-EXT: 29/69 JVT-AVC_V1: 95/135)
> > - h265: (JCT-VC-HEVC_V1: 142/147)
> > - vp9 : (VP9-TEST-VECTORS: 1/6 VP9-TEST-VECTORS: 276/305)
> > - av1 : (CHROMIUM-10bit-AV1-TEST-VECTORS: 22/23 CHROMIUM-8bit-
> > AV1-TEST-VECTORS: 11/13
> > - AV1-TEST-VECTORS: Ran 237/239)
>
> Thanks for the fluster reports, I cannot confirm this yet, since it
> does not
> apply. Note that you have forgot to provide V4L2 compliance report as
> requested.
>
I will add the compliance reulst in patch v3. The compliance result is
pass.
> >
> > - send the first version v1:
> > - Run 10bit VP9/AV1 fluster test pass.
> > - Will return error when the 10bit parameter no correctly in
> > function mtk_vdec_s_ctrl.
> > ---
> >
> > Reference series:
> > [1]: this series depends on v6 which is send by Yunfei Dong.
> > message-id: [email protected]
> >
> > Mingjia Zhang (3):
> > media: mediatek: vcodec: Add capture format to support 10bit tile
> > mode
> > media: mediatek: vcodec: Add capture format to support 10bit
> > raster
> > mode
> > media: mediatek: vcodec: Add driver to support 10bit
> >
> > .../media/v4l/pixfmt-reserved.rst | 13 ++
> > .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 22 ++-
> > .../vcodec/decoder/mtk_vcodec_dec_drv.h | 5 +
> > .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 144
> > +++++++++++++++++-
>
> vcodec/decoder directory no longer exists. Can you rebase your work
> please ?
>
This patch series is based on patch 'separate encoder and decoder'.
vcodec/decoder folder is added in that patch.
Best Regards,
Yunfei Dong
> Nicolas
>
> > drivers/media/v4l2-core/v4l2-common.c | 4 +
> > drivers/media/v4l2-core/v4l2-ioctl.c | 2 +
> > include/uapi/linux/videodev2.h | 2 +
> > 7 files changed, 188 insertions(+), 4 deletions(-)
> >
>
>