linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Enable video decoder & encoder for MT8189
@ 2025-08-11  3:26 Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 1/8] dt-bindings: media: mediatek: decoder: Add MT8189 mediatek,vcodec-decoder Kyrie Wu
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

This series have the follow changing:
Firstly add mt8189 video decoder compatible, profile and level to support
MT8189 kernel driver.
Secondly fix some bugs, including vp 4K profile2 and media device node
number bug.
Lastly, add mt8189 video encoder compatible.

This series has been tested with MT8189 tast test.
Encoding and decoding worked for this chip.

Patches 1-2 Add decoder compatible.
Patches 3 Add profile and level supporting.
Patches 4 Add core-only VP9 decoding supporting.
Patches 5-6 fix some bugs.
Patches 7-8 Adds encoder compatible.

---
v4l2-compliance test results:
v4l2-compliance -d /dev/video2
v4l2-compliance 1.28.1, 64 bits, 64-bit time_t

Compliance test for mtk-vcodec-enc device /dev/video2:

Driver Info:
        Driver name      : mtk-vcodec-enc
        Card type        : MT8189 video encoder
        Bus info         : platform:17020000.video-codec
        Driver version   : 6.6.88
        Capabilities     : 0x84204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format
        Detected Stateful Encoder

Required ioctls:
        test VIDIOC_QUERYCAP: OK
        test invalid ioctls: OK

Allow for multiple opens:
        test second /dev/video2 open: OK
        test VIDIOC_QUERYCAP: OK
        test VIDIOC_G/S_PRIORITY: OK
        test for unlimited opens: OK

Debug ioctls:
        test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
        test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
        test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
        test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
        test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
        test VIDIOC_ENUMAUDIO: OK (Not Supported)
        test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
        test VIDIOC_G/S_AUDIO: OK (Not Supported)
        Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
        test VIDIOC_G/S_MODULATOR: OK (Not Supported)
        test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
        test VIDIOC_ENUMAUDOUT: OK (Not Supported)
        test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
        test VIDIOC_G/S_AUDOUT: OK (Not Supported)
        Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
        test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
        test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
        test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
        test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:
        test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
        test VIDIOC_QUERYCTRL: OK
        test VIDIOC_G/S_CTRL: OK
        test VIDIOC_G/S/TRY_EXT_CTRLS: OK
                fail: v4l2-test-controls.cpp(1171): node->codec_mask & STATEFUL_ENCODER
        test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
        test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
        Standard Controls: 16 Private Controls: 0

Format ioctls:
        test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
        test VIDIOC_G/S_PARM: OK
        test VIDIOC_G_FBUF: OK (Not Supported)
        test VIDIOC_G_FMT: OK
        test VIDIOC_TRY_FMT: OK
        test VIDIOC_S_FMT: OK
        test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
        test Cropping: OK
        test Composing: OK (Not Supported)
        test Scaling: OK (Not Supported)

Codec ioctls:
        test VIDIOC_(TRY_)ENCODER_CMD: OK
        test VIDIOC_G_ENC_INDEX: OK (Not Supported)
        test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
        test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
        test CREATE_BUFS maximum buffers: OK
        test VIDIOC_REMOVE_BUFS: OK
        test VIDIOC_EXPBUF: OK
        test Requests: OK (Not Supported)

Total for mtk-vcodec-enc device /dev/video2: 47, Succeeded: 46, Failed: 1, Warnings: 0

v4l2-compliance -d /dev/video3
v4l2-compliance 1.28.1, 64 bits, 64-bit time_t

Compliance test for mtk-vcodec-dec device /dev/video3:

Driver Info:
        Driver name      : mtk-vcodec-dec
        Card type        : MT8189 video decoder
        Bus info         : platform:16000000.video-codec
        Driver version   : 6.6.88
        Capabilities     : 0x84204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format
        Detected Stateless Decoder
Media Driver Info:
        Driver name      : mtk-vcodec-dec
        Model            : mtk-vcodec-dec
        Serial           : 
        Bus info         : platform:16000000.video-codec
        Media version    : 6.6.88
        Hardware revision: 0x00000000 (0)
        Driver version   : 6.6.88
Interface Info:
        ID               : 0x0300000c
        Type             : V4L Video
Entity Info:
        ID               : 0x00000001 (1)
        Name             : mtk-vcodec-dec-source
        Function         : V4L2 I/O
        Pad 0x01000002   : 0: Source
          Link 0x02000008: to remote pad 0x1000004 of entity 'mtk-vcodec-dec-proc' (Video Decoder): Data, Enabled, Immutable

Required ioctls:
        test MC information (see 'Media Driver Info' above): OK
        test VIDIOC_QUERYCAP: OK
        test invalid ioctls: OK

Allow for multiple opens:
        test second /dev/video3 open: OK
        test VIDIOC_QUERYCAP: OK
        test VIDIOC_G/S_PRIORITY: OK
        test for unlimited opens: OK

Debug ioctls:
        test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
        test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
        test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
        test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
        test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
        test VIDIOC_ENUMAUDIO: OK (Not Supported)
        test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
        test VIDIOC_G/S_AUDIO: OK (Not Supported)
        Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
        test VIDIOC_G/S_MODULATOR: OK (Not Supported)
        test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
        test VIDIOC_ENUMAUDOUT: OK (Not Supported)
        test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
        test VIDIOC_G/S_AUDOUT: OK (Not Supported)
        Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
        test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
        test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
        test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
        test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:
        test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
        test VIDIOC_QUERYCTRL: OK
        test VIDIOC_G/S_CTRL: OK
        test VIDIOC_G/S/TRY_EXT_CTRLS: OK
        test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
        test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
        Standard Controls: 15 Private Controls: 2
        Standard Compound Controls: 13 Private Compound Controls: 0

Format ioctls:
        test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
        test VIDIOC_G/S_PARM: OK (Not Supported)
        test VIDIOC_G_FBUF: OK (Not Supported)
        test VIDIOC_G_FMT: OK
        test VIDIOC_TRY_FMT: OK
        test VIDIOC_S_FMT: OK
        test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
        test Cropping: OK (Not Supported)
        test Composing: OK
        test Scaling: OK (Not Supported)

Codec ioctls:
        test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
        test VIDIOC_G_ENC_INDEX: OK (Not Supported)
        test VIDIOC_(TRY_)DECODER_CMD: OK

Buffer ioctls:
        test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
        test CREATE_BUFS maximum buffers: OK
        test VIDIOC_REMOVE_BUFS: OK
        test VIDIOC_EXPBUF: OK
        test Requests: OK

Total for mtk-vcodec-dec device /dev/video3: 48, Succeeded: 48, Failed: 0, Warnings: 0

scp upstream link:
https://patchwork.kernel.org/project/linux-mediatek/patch/20250811015922.32680-1-huayu.zong@mediatek.com/

Changes compared with v1:
--add v4l2-compliance test results
--add scp upstream link
--add HW difference discriptions for dt-bindings commit messages

This series patches dependent on:
[1]
https://patchwork.linuxtv.org/project/linux-media/cover/20250510075357.11761-1-yunfei.dong@mediatek.com/
[2]
https://patchwork.linuxtv.org/project/linux-media/cover/20250528063633.14054-1-irui.wang@mediatek.com/

Kyrie Wu (8):
  dt-bindings: media: mediatek: decoder: Add MT8189
    mediatek,vcodec-decoder
  media: mediatek: vcodec: add decoder compatible to support MT8189
  media: mediatek: vcodec: add profile and level supporting for MT8189
  media: mediatek: vcodec: Add core-only VP9 decoding support for MT8189
  media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2
  media: mediatek: vcodec: fix media device node number
  dt-bindings: media: Add MT8189 mediatek,vcodec-encoder
  media: mediatek: encoder: Add MT8189 encoder compatible data

 .../media/mediatek,vcodec-encoder.yaml        |  2 ++
 .../media/mediatek,vcodec-subdev-decoder.yaml |  1 +
 .../vcodec/decoder/mtk_vcodec_dec_drv.c       |  9 +++++-
 .../vcodec/decoder/mtk_vcodec_dec_drv.h       |  1 +
 .../vcodec/decoder/mtk_vcodec_dec_stateless.c |  4 +++
 .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 32 ++++++++++++-------
 .../vcodec/encoder/mtk_vcodec_enc_drv.c       | 14 ++++++++
 7 files changed, 50 insertions(+), 13 deletions(-)

-- 
2.46.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2 1/8] dt-bindings: media: mediatek: decoder: Add MT8189 mediatek,vcodec-decoder
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
@ 2025-08-11  3:26 ` Kyrie Wu
  2025-08-11  8:07   ` Krzysztof Kozlowski
  2025-08-11  3:26 ` [PATCH v2 2/8] media: mediatek: vcodec: add decoder compatible to support MT8189 Kyrie Wu
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

Add compatible for video decoder on MT8189 platform. Compared with
former ICs, the MT8189 decoder use iommu to instead of smmu, and
use scp architecture, the frequency is only 406MHZ, and cannot reach
more than 700MHZ. At the same time, the decoder supports the vp9
decoding protocol for the first time in single IC.

Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
---
 .../bindings/media/mediatek,vcodec-subdev-decoder.yaml           | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
index 74e1d88d3056..1bb5a2485e4c 100644
--- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
@@ -77,6 +77,7 @@ properties:
       - mediatek,mt8188-vcodec-dec
       - mediatek,mt8195-vcodec-dec
       - mediatek,mt8196-vcodec-dec
+      - mediatek,mt8189-vcodec-dec
 
   reg:
     minItems: 1
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 2/8] media: mediatek: vcodec: add decoder compatible to support MT8189
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 1/8] dt-bindings: media: mediatek: decoder: Add MT8189 mediatek,vcodec-decoder Kyrie Wu
@ 2025-08-11  3:26 ` Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 3/8] media: mediatek: vcodec: add profile and level supporting for MT8189 Kyrie Wu
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

MT8189 is pure single core architecture. Support its compatible and
use `mtk_vdec_single_core_pdata` to initialize platform data.

Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
---
 .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c   | 6 ++++++
 .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h   | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c
index fabf969bc8a9..e7b6b108f4fb 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c
@@ -348,6 +348,8 @@ static void mtk_vcodec_dec_get_chip_name(struct mtk_vcodec_dec_dev *vdec_dev)
 		vdec_dev->chip_name = MTK_VDEC_MT8188;
 	else if (of_device_is_compatible(dev->of_node, "mediatek,mt8196-vcodec-dec"))
 		vdec_dev->chip_name = MTK_VDEC_MT8196;
+	else if (of_device_is_compatible(dev->of_node, "mediatek,mt8189-vcodec-dec"))
+		vdec_dev->chip_name = MTK_VDEC_MT8189;
 	else
 		vdec_dev->chip_name = MTK_VDEC_INVAL;
 }
@@ -575,6 +577,10 @@ static const struct of_device_id mtk_vcodec_match[] = {
 		.compatible = "mediatek,mt8196-vcodec-dec",
 		.data = &mtk_lat_sig_core_pdata,
 	},
+	{
+		.compatible = "mediatek,mt8189-vcodec-dec",
+		.data = &mtk_vdec_single_core_pdata,
+	},
 	{},
 };
 
diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h
index 6bdde600a167..856d12aa84d8 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h
+++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h
@@ -25,6 +25,7 @@ enum mtk_vcodec_dec_chip_name {
 	MTK_VDEC_MT8183 = 8183,
 	MTK_VDEC_MT8186 = 8186,
 	MTK_VDEC_MT8188 = 8188,
+	MTK_VDEC_MT8189 = 8189,
 	MTK_VDEC_MT8192 = 8192,
 	MTK_VDEC_MT8195 = 8195,
 	MTK_VDEC_MT8196 = 8196,
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 3/8] media: mediatek: vcodec: add profile and level supporting for MT8189
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 1/8] dt-bindings: media: mediatek: decoder: Add MT8189 mediatek,vcodec-decoder Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 2/8] media: mediatek: vcodec: add decoder compatible to support MT8189 Kyrie Wu
@ 2025-08-11  3:26 ` Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 4/8] media: mediatek: vcodec: Add core-only VP9 decoding support " Kyrie Wu
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

add profile and level supporting for H264 and vp9 of MT8189

Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
---
 .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
index c1cef78471a9..0a9bdc5316f9 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c
@@ -552,6 +552,7 @@ static void mtk_vcodec_dec_fill_h264_level(struct v4l2_ctrl_config *cfg,
 	switch (ctx->dev->chip_name) {
 	case MTK_VDEC_MT8192:
 	case MTK_VDEC_MT8188:
+	case MTK_VDEC_MT8189:
 		cfg->max = V4L2_MPEG_VIDEO_H264_LEVEL_5_2;
 		break;
 	case MTK_VDEC_MT8195:
@@ -573,6 +574,7 @@ static void mtk_vcodec_dec_fill_h264_profile(struct v4l2_ctrl_config *cfg,
 {
 	switch (ctx->dev->chip_name) {
 	case MTK_VDEC_MT8188:
+	case MTK_VDEC_MT8189:
 	case MTK_VDEC_MT8195:
 	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10;
@@ -623,6 +625,7 @@ static void mtk_vcodec_dec_fill_vp9_level(struct v4l2_ctrl_config *cfg,
 	case MTK_VDEC_MT8188:
 		cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_5_1;
 		break;
+	case MTK_VDEC_MT8189:
 	case MTK_VDEC_MT8195:
 	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_VP9_LEVEL_5_2;
@@ -641,6 +644,7 @@ static void mtk_vcodec_dec_fill_vp9_profile(struct v4l2_ctrl_config *cfg,
 {
 	switch (ctx->dev->chip_name) {
 	case MTK_VDEC_MT8188:
+	case MTK_VDEC_MT8189:
 	case MTK_VDEC_MT8195:
 	case MTK_VDEC_MT8196:
 		cfg->max = V4L2_MPEG_VIDEO_VP9_PROFILE_2;
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 4/8] media: mediatek: vcodec: Add core-only VP9 decoding support for MT8189
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
                   ` (2 preceding siblings ...)
  2025-08-11  3:26 ` [PATCH v2 3/8] media: mediatek: vcodec: add profile and level supporting for MT8189 Kyrie Wu
@ 2025-08-11  3:26 ` Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 5/8] media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2 Kyrie Wu
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

Implemented core-only VP9 decoding functions for MT8189.

Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
---
 .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 27 +++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
index fa0f406f7726..04197164fb82 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
@@ -23,6 +23,7 @@
 
 #define VP9_TILE_BUF_SIZE 4096
 #define VP9_PROB_BUF_SIZE 2560
+#define VP9_PROB_BUF_4K_SIZE 3840
 #define VP9_COUNTS_BUF_SIZE 16384
 
 #define HDR_FLAG(x) (!!((hdr)->flags & V4L2_VP9_FRAME_FLAG_##x))
@@ -616,7 +617,10 @@ static int vdec_vp9_slice_alloc_working_buffer(struct vdec_vp9_slice_instance *i
 	}
 
 	if (!instance->prob.va) {
-		instance->prob.size = VP9_PROB_BUF_SIZE;
+		instance->prob.size = ((ctx->dev->chip_name == MTK_VDEC_MT8196) ||
+				       (ctx->dev->chip_name == MTK_VDEC_MT8189)) ?
+					VP9_PROB_BUF_4K_SIZE : VP9_PROB_BUF_SIZE;
+
 		if (mtk_vcodec_mem_alloc(ctx, &instance->prob))
 			goto err;
 	}
@@ -696,21 +700,22 @@ static int vdec_vp9_slice_tile_offset(int idx, int mi_num, int tile_log2)
 	return min(offset, mi_num);
 }
 
-static
-int vdec_vp9_slice_setup_single_from_src_to_dst(struct vdec_vp9_slice_instance *instance)
+static int vdec_vp9_slice_setup_single_from_src_to_dst(struct vdec_vp9_slice_instance *instance,
+						       struct mtk_vcodec_mem *bs,
+						       struct vdec_fb *fb)
 {
-	struct vb2_v4l2_buffer *src;
-	struct vb2_v4l2_buffer *dst;
+	struct mtk_video_dec_buf *src_buf_info;
+	struct mtk_video_dec_buf *dst_buf_info;
 
-	src = v4l2_m2m_next_src_buf(instance->ctx->m2m_ctx);
-	if (!src)
+	src_buf_info = container_of(bs, struct mtk_video_dec_buf, bs_buffer);
+	if (!src_buf_info)
 		return -EINVAL;
 
-	dst = v4l2_m2m_next_dst_buf(instance->ctx->m2m_ctx);
-	if (!dst)
+	dst_buf_info = container_of(fb, struct mtk_video_dec_buf, frame_buffer);
+	if (!dst_buf_info)
 		return -EINVAL;
 
-	v4l2_m2m_buf_copy_metadata(src, dst, true);
+	v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb, &dst_buf_info->m2m_buf.vb, true);
 
 	return 0;
 }
@@ -1800,7 +1805,7 @@ static int vdec_vp9_slice_setup_single(struct vdec_vp9_slice_instance *instance,
 	struct vdec_vp9_slice_vsi *vsi = &pfc->vsi;
 	int ret;
 
-	ret = vdec_vp9_slice_setup_single_from_src_to_dst(instance);
+	ret = vdec_vp9_slice_setup_single_from_src_to_dst(instance, bs, fb);
 	if (ret)
 		goto err;
 
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 5/8] media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
                   ` (3 preceding siblings ...)
  2025-08-11  3:26 ` [PATCH v2 4/8] media: mediatek: vcodec: Add core-only VP9 decoding support " Kyrie Wu
@ 2025-08-11  3:26 ` Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 6/8] media: mediatek: vcodec: fix media device node number Kyrie Wu
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

The dram addr of vp9 decoder tile number, which use dram mode
to set tile information, may reach to 36bits for 4096x2176.
It needs to get the highest 4bit of tile buffer address to
set tile buffer address.

Fixes: 5d418351ca8f1 ("media: mediatek: vcodec: support stateless VP9 decoding")
Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
---
 .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
index 04197164fb82..416d8c0c04ce 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
@@ -1140,7 +1140,10 @@ static int vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance *inst
 			tiles->size[i][j] = size;
 			if (tiles->mi_rows[i]) {
 				*tb++ = (size << 3) + ((offset << 3) & 0x7f);
-				*tb++ = pa & ~0xf;
+				*tb = pa & ~0xf;
+				if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT))
+					*tb |= (pa >> 32) & 0xf;
+				tb++;
 				*tb++ = (pa << 3) & 0x7f;
 				mi_row = (tiles->mi_rows[i] - 1) & 0x1ff;
 				mi_col = (tiles->mi_cols[j] - 1) & 0x3f;
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 6/8] media: mediatek: vcodec: fix media device node number
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
                   ` (4 preceding siblings ...)
  2025-08-11  3:26 ` [PATCH v2 5/8] media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2 Kyrie Wu
@ 2025-08-11  3:26 ` Kyrie Wu
  2025-08-11  3:26 ` [PATCH v2 7/8] dt-bindings: media: Add MT8189 mediatek,vcodec-encoder Kyrie Wu
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

change media register device node number to a correct value

Fixes: 41f03c673cb7b ("media: mediatek: vcodec: replace pr_* with dev_* for v4l2 debug message")
Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
---
 .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c
index e7b6b108f4fb..bc0a66c26cda 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c
@@ -517,7 +517,8 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
 			goto err_media_reg;
 		}
 
-		dev_dbg(&pdev->dev, "media registered as /dev/media%d", vfd_dec->minor);
+		dev_dbg(&pdev->dev, "media registered as /dev/media%d",
+			dev->mdev_dec.devnode->minor);
 	}
 
 	mtk_vcodec_dbgfs_init(dev, false);
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 7/8] dt-bindings: media: Add MT8189 mediatek,vcodec-encoder
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
                   ` (5 preceding siblings ...)
  2025-08-11  3:26 ` [PATCH v2 6/8] media: mediatek: vcodec: fix media device node number Kyrie Wu
@ 2025-08-11  3:26 ` Kyrie Wu
  2025-08-11  8:07   ` Krzysztof Kozlowski
  2025-08-11  3:26 ` [PATCH v2 8/8] media: mediatek: encoder: Add MT8189 encoder compatible data Kyrie Wu
  2025-08-11 14:43 ` [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Nicolas Dufresne
  8 siblings, 1 reply; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz, Krzysztof Kozlowski

Add MT8189 encoder compatible string to distinguish former ICs
MTK's. Compared with MT8196, the maximum resolution of MT8189
encoder is only 4K, and the fps is only 30, which cannot reach
the highest parameter of MT8196: level6.2, 8K@60fps.
Compared with MT8188, the level can only support 5.1, which is less
than 5.2 of MT8188. But the maximum bitrate is 100Mbps, which is twice
that of MT8188. And MT8189 could support NBM mode.

Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/media/mediatek,vcodec-encoder.yaml      | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml
index 7675391d7eb0..faee838d684e 100644
--- a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml
@@ -25,6 +25,7 @@ properties:
               - mediatek,mt8192-vcodec-enc
               - mediatek,mt8195-vcodec-enc
               - mediatek,mt8196-vcodec-enc
+              - mediatek,mt8189-vcodec-enc
       - items:
           - const: mediatek,mt8186-vcodec-enc
           - const: mediatek,mt8183-vcodec-enc
@@ -97,6 +98,7 @@ allOf:
               - mediatek,mt8188-vcodec-enc
               - mediatek,mt8192-vcodec-enc
               - mediatek,mt8195-vcodec-enc
+              - mediatek,mt8189-vcodec-enc
 
     then:
       required:
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 8/8] media: mediatek: encoder: Add MT8189 encoder compatible data
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
                   ` (6 preceding siblings ...)
  2025-08-11  3:26 ` [PATCH v2 7/8] dt-bindings: media: Add MT8189 mediatek,vcodec-encoder Kyrie Wu
@ 2025-08-11  3:26 ` Kyrie Wu
  2025-08-11 14:43 ` [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Nicolas Dufresne
  8 siblings, 0 replies; 17+ messages in thread
From: Kyrie Wu @ 2025-08-11  3:26 UTC (permalink / raw)
  To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Kyrie Wu, Hans Verkuil,
	Nicolas Dufresne, Christophe JAILLET, Sebastian Fricke,
	Nathan Hebert, Arnd Bergmann, Irui Wang, George Sun, linux-media,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

add compatible data to support MT8189 encoding.

Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
---
 .../mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c
index c869c4245ebc..4f5c2d8d2855 100644
--- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c
@@ -468,6 +468,19 @@ static const struct mtk_vcodec_enc_pdata mt8196_pdata = {
 	.set_dma_bit_mask = true,
 };
 
+static const struct mtk_vcodec_enc_pdata mt8189_pdata = {
+	.venc_model_num = 8189,
+	.capture_formats = mtk_video_formats_capture_h264,
+	.num_capture_formats = ARRAY_SIZE(mtk_video_formats_capture_h264),
+	.output_formats = mtk_video_formats_output,
+	.num_output_formats = ARRAY_SIZE(mtk_video_formats_output),
+	.min_bitrate = 64,
+	.max_bitrate = 100000000,
+	.core_id = VENC_SYS,
+	.uses_common_fw_iface = true,
+	.set_dma_bit_mask = true,
+};
+
 static const struct of_device_id mtk_vcodec_enc_match[] = {
 	{.compatible = "mediatek,mt8173-vcodec-enc",
 			.data = &mt8173_avc_pdata},
@@ -478,6 +491,7 @@ static const struct of_device_id mtk_vcodec_enc_match[] = {
 	{.compatible = "mediatek,mt8192-vcodec-enc", .data = &mt8192_pdata},
 	{.compatible = "mediatek,mt8195-vcodec-enc", .data = &mt8195_pdata},
 	{.compatible = "mediatek,mt8196-vcodec-enc", .data = &mt8196_pdata},
+	{.compatible = "mediatek,mt8189-vcodec-enc", .data = &mt8189_pdata},
 	{},
 };
 MODULE_DEVICE_TABLE(of, mtk_vcodec_enc_match);
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 1/8] dt-bindings: media: mediatek: decoder: Add MT8189 mediatek,vcodec-decoder
  2025-08-11  3:26 ` [PATCH v2 1/8] dt-bindings: media: mediatek: decoder: Add MT8189 mediatek,vcodec-decoder Kyrie Wu
@ 2025-08-11  8:07   ` Krzysztof Kozlowski
  2025-08-16  1:47     ` Kyrie Wu (吴晗)
  0 siblings, 1 reply; 17+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-11  8:07 UTC (permalink / raw)
  To: Kyrie Wu
  Cc: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Hans Verkuil, Nicolas Dufresne,
	Christophe JAILLET, Sebastian Fricke, Nathan Hebert,
	Arnd Bergmann, Irui Wang, George Sun, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Neil Armstrong,
	Andrzej Pietrasiewicz

On Mon, Aug 11, 2025 at 11:26:08AM +0800, Kyrie Wu wrote:
> Add compatible for video decoder on MT8189 platform. Compared with
> former ICs, the MT8189 decoder use iommu to instead of smmu, and
> use scp architecture, the frequency is only 406MHZ, and cannot reach
> more than 700MHZ. At the same time, the decoder supports the vp9
> decoding protocol for the first time in single IC.
> 
> Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
> ---
>  .../bindings/media/mediatek,vcodec-subdev-decoder.yaml           | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> index 74e1d88d3056..1bb5a2485e4c 100644
> --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> @@ -77,6 +77,7 @@ properties:
>        - mediatek,mt8188-vcodec-dec
>        - mediatek,mt8195-vcodec-dec
>        - mediatek,mt8196-vcodec-dec
> +      - mediatek,mt8189-vcodec-dec

Misplaced.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 7/8] dt-bindings: media: Add MT8189 mediatek,vcodec-encoder
  2025-08-11  3:26 ` [PATCH v2 7/8] dt-bindings: media: Add MT8189 mediatek,vcodec-encoder Kyrie Wu
@ 2025-08-11  8:07   ` Krzysztof Kozlowski
  2025-08-16  1:54     ` Kyrie Wu (吴晗)
  0 siblings, 1 reply; 17+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-11  8:07 UTC (permalink / raw)
  To: Kyrie Wu
  Cc: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Hans Verkuil, Nicolas Dufresne,
	Christophe JAILLET, Sebastian Fricke, Nathan Hebert,
	Arnd Bergmann, Irui Wang, George Sun, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Neil Armstrong,
	Andrzej Pietrasiewicz

On Mon, Aug 11, 2025 at 11:26:14AM +0800, Kyrie Wu wrote:
> Add MT8189 encoder compatible string to distinguish former ICs
> MTK's. Compared with MT8196, the maximum resolution of MT8189
> encoder is only 4K, and the fps is only 30, which cannot reach
> the highest parameter of MT8196: level6.2, 8K@60fps.
> Compared with MT8188, the level can only support 5.1, which is less
> than 5.2 of MT8188. But the maximum bitrate is 100Mbps, which is twice
> that of MT8188. And MT8189 could support NBM mode.
> 
> Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../devicetree/bindings/media/mediatek,vcodec-encoder.yaml      | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml
> index 7675391d7eb0..faee838d684e 100644
> --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml
> +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml
> @@ -25,6 +25,7 @@ properties:
>                - mediatek,mt8192-vcodec-enc
>                - mediatek,mt8195-vcodec-enc
>                - mediatek,mt8196-vcodec-enc
> +              - mediatek,mt8189-vcodec-enc

Same issue... you got these comments on your v1 of your other patchset,
didn't you?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/8] Enable video decoder & encoder for MT8189
  2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
                   ` (7 preceding siblings ...)
  2025-08-11  3:26 ` [PATCH v2 8/8] media: mediatek: encoder: Add MT8189 encoder compatible data Kyrie Wu
@ 2025-08-11 14:43 ` Nicolas Dufresne
  2025-08-16  1:58   ` Kyrie Wu (吴晗)
  2025-08-19  8:26   ` Kyrie Wu (吴晗)
  8 siblings, 2 replies; 17+ messages in thread
From: Nicolas Dufresne @ 2025-08-11 14:43 UTC (permalink / raw)
  To: Kyrie Wu, Tiffany Lin, Andrew-CT Chen, Yunfei Dong,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Hans Verkuil, Christophe JAILLET, Sebastian Fricke, Nathan Hebert,
	Arnd Bergmann, Irui Wang, George Sun, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Neil Armstrong, Andrzej Pietrasiewicz

[-- Attachment #1: Type: text/plain, Size: 11974 bytes --]

Hi,

Le lundi 11 août 2025 à 11:26 +0800, Kyrie Wu a écrit :
> This series have the follow changing:
> Firstly add mt8189 video decoder compatible, profile and level to support
> MT8189 kernel driver.
> Secondly fix some bugs, including vp 4K profile2 and media device node
> number bug.
> Lastly, add mt8189 video encoder compatible.
> 
> This series has been tested with MT8189 tast test.

As requested previously, please provide summary of the fluster tests results.
This has been a requirement for quite some time now. This will serve as
reference if this board get added to Kernel CI, which utilize fluster for
decoder coverage. The tast tests are unfortunately bound to ChromeOS (or Android
eventually as the first get decommission) and is very hard to reproduce with a
mainline kernel.

regards,
Nicolas

> Encoding and decoding worked for this chip.
> 
> Patches 1-2 Add decoder compatible.
> Patches 3 Add profile and level supporting.
> Patches 4 Add core-only VP9 decoding supporting.
> Patches 5-6 fix some bugs.
> Patches 7-8 Adds encoder compatible.
> 
> ---
> v4l2-compliance test results:
> v4l2-compliance -d /dev/video2
> v4l2-compliance 1.28.1, 64 bits, 64-bit time_t
> 
> Compliance test for mtk-vcodec-enc device /dev/video2:
> 
> Driver Info:
>         Driver name      : mtk-vcodec-enc
>         Card type        : MT8189 video encoder
>         Bus info         : platform:17020000.video-codec
>         Driver version   : 6.6.88
>         Capabilities     : 0x84204000
>                 Video Memory-to-Memory Multiplanar
>                 Streaming
>                 Extended Pix Format
>                 Device Capabilities
>         Device Caps      : 0x04204000
>                 Video Memory-to-Memory Multiplanar
>                 Streaming
>                 Extended Pix Format
>         Detected Stateful Encoder
> 
> Required ioctls:
>         test VIDIOC_QUERYCAP: OK
>         test invalid ioctls: OK
> 
> Allow for multiple opens:
>         test second /dev/video2 open: OK
>         test VIDIOC_QUERYCAP: OK
>         test VIDIOC_G/S_PRIORITY: OK
>         test for unlimited opens: OK
> 
> Debug ioctls:
>         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>         test VIDIOC_LOG_STATUS: OK (Not Supported)
> 
> Input ioctls:
>         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>         test VIDIOC_ENUMAUDIO: OK (Not Supported)
>         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>         test VIDIOC_G/S_AUDIO: OK (Not Supported)
>         Inputs: 0 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
>         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>         Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
>         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>         test VIDIOC_G/S_EDID: OK (Not Supported)
> 
> Control ioctls:
>         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>         test VIDIOC_QUERYCTRL: OK
>         test VIDIOC_G/S_CTRL: OK
>         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>                 fail: v4l2-test-controls.cpp(1171): node->codec_mask &
> STATEFUL_ENCODER
>         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
>         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>         Standard Controls: 16 Private Controls: 0
> 
> Format ioctls:
>         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>         test VIDIOC_G/S_PARM: OK
>         test VIDIOC_G_FBUF: OK (Not Supported)
>         test VIDIOC_G_FMT: OK
>         test VIDIOC_TRY_FMT: OK
>         test VIDIOC_S_FMT: OK
>         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>         test Cropping: OK
>         test Composing: OK (Not Supported)
>         test Scaling: OK (Not Supported)
> 
> Codec ioctls:
>         test VIDIOC_(TRY_)ENCODER_CMD: OK
>         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>         test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> 
> Buffer ioctls:
>         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>         test CREATE_BUFS maximum buffers: OK
>         test VIDIOC_REMOVE_BUFS: OK
>         test VIDIOC_EXPBUF: OK
>         test Requests: OK (Not Supported)
> 
> Total for mtk-vcodec-enc device /dev/video2: 47, Succeeded: 46, Failed: 1,
> Warnings: 0
> 
> v4l2-compliance -d /dev/video3
> v4l2-compliance 1.28.1, 64 bits, 64-bit time_t
> 
> Compliance test for mtk-vcodec-dec device /dev/video3:
> 
> Driver Info:
>         Driver name      : mtk-vcodec-dec
>         Card type        : MT8189 video decoder
>         Bus info         : platform:16000000.video-codec
>         Driver version   : 6.6.88
>         Capabilities     : 0x84204000
>                 Video Memory-to-Memory Multiplanar
>                 Streaming
>                 Extended Pix Format
>                 Device Capabilities
>         Device Caps      : 0x04204000
>                 Video Memory-to-Memory Multiplanar
>                 Streaming
>                 Extended Pix Format
>         Detected Stateless Decoder
> Media Driver Info:
>         Driver name      : mtk-vcodec-dec
>         Model            : mtk-vcodec-dec
>         Serial           : 
>         Bus info         : platform:16000000.video-codec
>         Media version    : 6.6.88
>         Hardware revision: 0x00000000 (0)
>         Driver version   : 6.6.88
> Interface Info:
>         ID               : 0x0300000c
>         Type             : V4L Video
> Entity Info:
>         ID               : 0x00000001 (1)
>         Name             : mtk-vcodec-dec-source
>         Function         : V4L2 I/O
>         Pad 0x01000002   : 0: Source
>           Link 0x02000008: to remote pad 0x1000004 of entity 'mtk-vcodec-dec-
> proc' (Video Decoder): Data, Enabled, Immutable
> 
> Required ioctls:
>         test MC information (see 'Media Driver Info' above): OK
>         test VIDIOC_QUERYCAP: OK
>         test invalid ioctls: OK
> 
> Allow for multiple opens:
>         test second /dev/video3 open: OK
>         test VIDIOC_QUERYCAP: OK
>         test VIDIOC_G/S_PRIORITY: OK
>         test for unlimited opens: OK
> 
> Debug ioctls:
>         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>         test VIDIOC_LOG_STATUS: OK (Not Supported)
> 
> Input ioctls:
>         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>         test VIDIOC_ENUMAUDIO: OK (Not Supported)
>         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>         test VIDIOC_G/S_AUDIO: OK (Not Supported)
>         Inputs: 0 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
>         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>         Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
>         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>         test VIDIOC_G/S_EDID: OK (Not Supported)
> 
> Control ioctls:
>         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>         test VIDIOC_QUERYCTRL: OK
>         test VIDIOC_G/S_CTRL: OK
>         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>         Standard Controls: 15 Private Controls: 2
>         Standard Compound Controls: 13 Private Compound Controls: 0
> 
> Format ioctls:
>         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>         test VIDIOC_G/S_PARM: OK (Not Supported)
>         test VIDIOC_G_FBUF: OK (Not Supported)
>         test VIDIOC_G_FMT: OK
>         test VIDIOC_TRY_FMT: OK
>         test VIDIOC_S_FMT: OK
>         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>         test Cropping: OK (Not Supported)
>         test Composing: OK
>         test Scaling: OK (Not Supported)
> 
> Codec ioctls:
>         test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>         test VIDIOC_(TRY_)DECODER_CMD: OK
> 
> Buffer ioctls:
>         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>         test CREATE_BUFS maximum buffers: OK
>         test VIDIOC_REMOVE_BUFS: OK
>         test VIDIOC_EXPBUF: OK
>         test Requests: OK
> 
> Total for mtk-vcodec-dec device /dev/video3: 48, Succeeded: 48, Failed: 0,
> Warnings: 0
> 
> scp upstream link:
> https://patchwork.kernel.org/project/linux-mediatek/patch/20250811015922.32680-1-huayu.zong@mediatek.com/
> 
> Changes compared with v1:
> --add v4l2-compliance test results
> --add scp upstream link
> --add HW difference discriptions for dt-bindings commit messages
> 
> This series patches dependent on:
> [1]
> https://patchwork.linuxtv.org/project/linux-media/cover/20250510075357.11761-1-yunfei.dong@mediatek.com/
> [2]
> https://patchwork.linuxtv.org/project/linux-media/cover/20250528063633.14054-1-irui.wang@mediatek.com/
> 
> Kyrie Wu (8):
>   dt-bindings: media: mediatek: decoder: Add MT8189
>     mediatek,vcodec-decoder
>   media: mediatek: vcodec: add decoder compatible to support MT8189
>   media: mediatek: vcodec: add profile and level supporting for MT8189
>   media: mediatek: vcodec: Add core-only VP9 decoding support for MT8189
>   media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2
>   media: mediatek: vcodec: fix media device node number
>   dt-bindings: media: Add MT8189 mediatek,vcodec-encoder
>   media: mediatek: encoder: Add MT8189 encoder compatible data
> 
>  .../media/mediatek,vcodec-encoder.yaml        |  2 ++
>  .../media/mediatek,vcodec-subdev-decoder.yaml |  1 +
>  .../vcodec/decoder/mtk_vcodec_dec_drv.c       |  9 +++++-
>  .../vcodec/decoder/mtk_vcodec_dec_drv.h       |  1 +
>  .../vcodec/decoder/mtk_vcodec_dec_stateless.c |  4 +++
>  .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 32 ++++++++++++-------
>  .../vcodec/encoder/mtk_vcodec_enc_drv.c       | 14 ++++++++
>  7 files changed, 50 insertions(+), 13 deletions(-)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 1/8] dt-bindings: media: mediatek: decoder: Add MT8189 mediatek,vcodec-decoder
  2025-08-11  8:07   ` Krzysztof Kozlowski
@ 2025-08-16  1:47     ` Kyrie Wu (吴晗)
  0 siblings, 0 replies; 17+ messages in thread
From: Kyrie Wu (吴晗) @ 2025-08-16  1:47 UTC (permalink / raw)
  To: krzk@kernel.org
  Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	George Sun (孙林),
	Tiffany Lin (林慧珊), andrzejtp2010@gmail.com,
	nhebert@chromium.org, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org, mchehab@kernel.org,
	hverkuil@xs4all.nl, nicolas.dufresne@collabora.com,
	Kyrie Wu (吴晗),
	Yunfei Dong (董云飞), conor+dt@kernel.org,
	Irui Wang (王瑞), robh@kernel.org,
	sebastian.fricke@collabora.com,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	christophe.jaillet@wanadoo.fr, krzk+dt@kernel.org, arnd@arndb.de,
	Andrew-CT Chen (陳智迪),
	AngeloGioacchino Del Regno, neil.armstrong@linaro.org

On Mon, 2025-08-11 at 10:07 +0200, Krzysztof Kozlowski wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Mon, Aug 11, 2025 at 11:26:08AM +0800, Kyrie Wu wrote:
> > Add compatible for video decoder on MT8189 platform. Compared with
> > former ICs, the MT8189 decoder use iommu to instead of smmu, and
> > use scp architecture, the frequency is only 406MHZ, and cannot
> > reach
> > more than 700MHZ. At the same time, the decoder supports the vp9
> > decoding protocol for the first time in single IC.
> > 
> > Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
> > ---
> >  .../bindings/media/mediatek,vcodec-subdev-decoder.yaml           | 
> > 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-
> > decoder.yaml
> > b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-
> > decoder.yaml
> > index 74e1d88d3056..1bb5a2485e4c 100644
> > --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-
> > subdev-decoder.yaml
> > +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-
> > subdev-decoder.yaml
> > @@ -77,6 +77,7 @@ properties:
> >        - mediatek,mt8188-vcodec-dec
> >        - mediatek,mt8195-vcodec-dec
> >        - mediatek,mt8196-vcodec-dec
> > +      - mediatek,mt8189-vcodec-dec
> 
> Misplaced.
> 
> Best regards,
> Krzysztof
> 
Dear Krzysztof,

Thanks for your reminding, I will reorder it in the coming version.

Regards,
Kyrie.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 7/8] dt-bindings: media: Add MT8189 mediatek,vcodec-encoder
  2025-08-11  8:07   ` Krzysztof Kozlowski
@ 2025-08-16  1:54     ` Kyrie Wu (吴晗)
  0 siblings, 0 replies; 17+ messages in thread
From: Kyrie Wu (吴晗) @ 2025-08-16  1:54 UTC (permalink / raw)
  To: krzysztof.kozlowski@linaro.org
  Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	George Sun (孙林),
	Tiffany Lin (林慧珊), andrzejtp2010@gmail.com,
	nhebert@chromium.org, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org, mchehab@kernel.org,
	hverkuil@xs4all.nl, nicolas.dufresne@collabora.com,
	Kyrie Wu (吴晗),
	Yunfei Dong (董云飞), conor+dt@kernel.org,
	Irui Wang (王瑞), robh@kernel.org,
	sebastian.fricke@collabora.com,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	christophe.jaillet@wanadoo.fr, krzk+dt@kernel.org, arnd@arndb.de,
	Andrew-CT Chen (陳智迪),
	AngeloGioacchino Del Regno, neil.armstrong@linaro.org

On Mon, 2025-08-11 at 10:07 +0200, Krzysztof Kozlowski wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Mon, Aug 11, 2025 at 11:26:14AM +0800, Kyrie Wu wrote:
> > Add MT8189 encoder compatible string to distinguish former ICs
> > MTK's. Compared with MT8196, the maximum resolution of MT8189
> > encoder is only 4K, and the fps is only 30, which cannot reach
> > the highest parameter of MT8196: level6.2, 8K@60fps.
> > Compared with MT8188, the level can only support 5.1, which is less
> > than 5.2 of MT8188. But the maximum bitrate is 100Mbps, which is
> > twice
> > that of MT8188. And MT8189 could support NBM mode.
> > 
> > Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  .../devicetree/bindings/media/mediatek,vcodec-encoder.yaml      |
> > 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/media/mediatek,vcodec-
> > encoder.yaml
> > b/Documentation/devicetree/bindings/media/mediatek,vcodec-
> > encoder.yaml
> > index 7675391d7eb0..faee838d684e 100644
> > --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-
> > encoder.yaml
> > +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-
> > encoder.yaml
> > @@ -25,6 +25,7 @@ properties:
> >                - mediatek,mt8192-vcodec-enc
> >                - mediatek,mt8195-vcodec-enc
> >                - mediatek,mt8196-vcodec-enc
> > +              - mediatek,mt8189-vcodec-enc
> 
> Same issue... you got these comments on your v1 of your other
> patchset,
> didn't you?
> 
> Best regards,
> Krzysztof
> 
Dear Krzysztof,

Thanks again. I might have overlooked the comments,
but I previously only sent a patch set of 8196 JPEG and
placed it at the end of properties strings.

I'll correct this in the next version.

Thank you.

Regards,
Kyrie.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/8] Enable video decoder & encoder for MT8189
  2025-08-11 14:43 ` [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Nicolas Dufresne
@ 2025-08-16  1:58   ` Kyrie Wu (吴晗)
  2025-08-19  8:26   ` Kyrie Wu (吴晗)
  1 sibling, 0 replies; 17+ messages in thread
From: Kyrie Wu (吴晗) @ 2025-08-16  1:58 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	George Sun (孙林),
	Tiffany Lin (林慧珊), nhebert@chromium.org,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	mchehab@kernel.org, nicolas.dufresne@collabora.com,
	hverkuil@xs4all.nl, Kyrie Wu (吴晗),
	Yunfei Dong (董云飞), conor+dt@kernel.org,
	Irui Wang (王瑞), robh@kernel.org,
	sebastian.fricke@collabora.com,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	christophe.jaillet@wanadoo.fr, krzk+dt@kernel.org, arnd@arndb.de,
	Andrew-CT Chen (陳智迪),
	AngeloGioacchino Del Regno
  Cc: andrzejtp2010@gmail.com, neil.armstrong@linaro.org

On Mon, 2025-08-11 at 10:43 -0400, Nicolas Dufresne wrote:
> Hi,
> 
> Le lundi 11 août 2025 à 11:26 +0800, Kyrie Wu a écrit :
> > This series have the follow changing:
> > Firstly add mt8189 video decoder compatible, profile and level to
> > support
> > MT8189 kernel driver.
> > Secondly fix some bugs, including vp 4K profile2 and media device
> > node
> > number bug.
> > Lastly, add mt8189 video encoder compatible.
> > 
> > This series has been tested with MT8189 tast test.
> 
> As requested previously, please provide summary of the fluster tests
> results.
> This has been a requirement for quite some time now. This will serve
> as
> reference if this board get added to Kernel CI, which utilize fluster
> for
> decoder coverage. The tast tests are unfortunately bound to ChromeOS
> (or Android
> eventually as the first get decommission) and is very hard to
> reproduce with a
> mainline kernel.
> 
> regards,
> Nicolas

Dear Nicolas,

I apologize for not including the fluster test results,
as I believe the v4l2-cpmpliance test already proves
the decoder is fully functional. I will include the fluster test
results in the next version.

Thanks.

Regards,
Kyrie.

> 
> > Encoding and decoding worked for this chip.
> > 
> > Patches 1-2 Add decoder compatible.
> > Patches 3 Add profile and level supporting.
> > Patches 4 Add core-only VP9 decoding supporting.
> > Patches 5-6 fix some bugs.
> > Patches 7-8 Adds encoder compatible.
> > 
> > ---
> > v4l2-compliance test results:
> > v4l2-compliance -d /dev/video2
> > v4l2-compliance 1.28.1, 64 bits, 64-bit time_t
> > 
> > Compliance test for mtk-vcodec-enc device /dev/video2:
> > 
> > Driver Info:
> >         Driver name      : mtk-vcodec-enc
> >         Card type        : MT8189 video encoder
> >         Bus info         : platform:17020000.video-codec
> >         Driver version   : 6.6.88
> >         Capabilities     : 0x84204000
> >                 Video Memory-to-Memory Multiplanar
> >                 Streaming
> >                 Extended Pix Format
> >                 Device Capabilities
> >         Device Caps      : 0x04204000
> >                 Video Memory-to-Memory Multiplanar
> >                 Streaming
> >                 Extended Pix Format
> >         Detected Stateful Encoder
> > 
> > Required ioctls:
> >         test VIDIOC_QUERYCAP: OK
> >         test invalid ioctls: OK
> > 
> > Allow for multiple opens:
> >         test second /dev/video2 open: OK
> >         test VIDIOC_QUERYCAP: OK
> >         test VIDIOC_G/S_PRIORITY: OK
> >         test for unlimited opens: OK
> > 
> > Debug ioctls:
> >         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> >         test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> >         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> >         test VIDIOC_ENUMAUDIO: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDIO: OK (Not Supported)
> >         Inputs: 0 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> >         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> >         Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> >         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> >         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> >         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> >         test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls:
> >         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> >         test VIDIOC_QUERYCTRL: OK
> >         test VIDIOC_G/S_CTRL: OK
> >         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> >                 fail: v4l2-test-controls.cpp(1171): node-
> > >codec_mask &
> > STATEFUL_ENCODER
> >         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> >         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> >         Standard Controls: 16 Private Controls: 0
> > 
> > Format ioctls:
> >         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> >         test VIDIOC_G/S_PARM: OK
> >         test VIDIOC_G_FBUF: OK (Not Supported)
> >         test VIDIOC_G_FMT: OK
> >         test VIDIOC_TRY_FMT: OK
> >         test VIDIOC_S_FMT: OK
> >         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> >         test Cropping: OK
> >         test Composing: OK (Not Supported)
> >         test Scaling: OK (Not Supported)
> > 
> > Codec ioctls:
> >         test VIDIOC_(TRY_)ENCODER_CMD: OK
> >         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> >         test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> > 
> > Buffer ioctls:
> >         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> >         test CREATE_BUFS maximum buffers: OK
> >         test VIDIOC_REMOVE_BUFS: OK
> >         test VIDIOC_EXPBUF: OK
> >         test Requests: OK (Not Supported)
> > 
> > Total for mtk-vcodec-enc device /dev/video2: 47, Succeeded: 46,
> > Failed: 1,
> > Warnings: 0
> > 
> > v4l2-compliance -d /dev/video3
> > v4l2-compliance 1.28.1, 64 bits, 64-bit time_t
> > 
> > Compliance test for mtk-vcodec-dec device /dev/video3:
> > 
> > Driver Info:
> >         Driver name      : mtk-vcodec-dec
> >         Card type        : MT8189 video decoder
> >         Bus info         : platform:16000000.video-codec
> >         Driver version   : 6.6.88
> >         Capabilities     : 0x84204000
> >                 Video Memory-to-Memory Multiplanar
> >                 Streaming
> >                 Extended Pix Format
> >                 Device Capabilities
> >         Device Caps      : 0x04204000
> >                 Video Memory-to-Memory Multiplanar
> >                 Streaming
> >                 Extended Pix Format
> >         Detected Stateless Decoder
> > Media Driver Info:
> >         Driver name      : mtk-vcodec-dec
> >         Model            : mtk-vcodec-dec
> >         Serial           : 
> >         Bus info         : platform:16000000.video-codec
> >         Media version    : 6.6.88
> >         Hardware revision: 0x00000000 (0)
> >         Driver version   : 6.6.88
> > Interface Info:
> >         ID               : 0x0300000c
> >         Type             : V4L Video
> > Entity Info:
> >         ID               : 0x00000001 (1)
> >         Name             : mtk-vcodec-dec-source
> >         Function         : V4L2 I/O
> >         Pad 0x01000002   : 0: Source
> >           Link 0x02000008: to remote pad 0x1000004 of entity 'mtk-
> > vcodec-dec-
> > proc' (Video Decoder): Data, Enabled, Immutable
> > 
> > Required ioctls:
> >         test MC information (see 'Media Driver Info' above): OK
> >         test VIDIOC_QUERYCAP: OK
> >         test invalid ioctls: OK
> > 
> > Allow for multiple opens:
> >         test second /dev/video3 open: OK
> >         test VIDIOC_QUERYCAP: OK
> >         test VIDIOC_G/S_PRIORITY: OK
> >         test for unlimited opens: OK
> > 
> > Debug ioctls:
> >         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> >         test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> >         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> >         test VIDIOC_ENUMAUDIO: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDIO: OK (Not Supported)
> >         Inputs: 0 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> >         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> >         Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> >         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> >         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> >         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> >         test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls:
> >         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> >         test VIDIOC_QUERYCTRL: OK
> >         test VIDIOC_G/S_CTRL: OK
> >         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> >         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> >         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> >         Standard Controls: 15 Private Controls: 2
> >         Standard Compound Controls: 13 Private Compound Controls: 0
> > 
> > Format ioctls:
> >         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> >         test VIDIOC_G/S_PARM: OK (Not Supported)
> >         test VIDIOC_G_FBUF: OK (Not Supported)
> >         test VIDIOC_G_FMT: OK
> >         test VIDIOC_TRY_FMT: OK
> >         test VIDIOC_S_FMT: OK
> >         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> >         test Cropping: OK (Not Supported)
> >         test Composing: OK
> >         test Scaling: OK (Not Supported)
> > 
> > Codec ioctls:
> >         test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> >         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> >         test VIDIOC_(TRY_)DECODER_CMD: OK
> > 
> > Buffer ioctls:
> >         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> >         test CREATE_BUFS maximum buffers: OK
> >         test VIDIOC_REMOVE_BUFS: OK
> >         test VIDIOC_EXPBUF: OK
> >         test Requests: OK
> > 
> > Total for mtk-vcodec-dec device /dev/video3: 48, Succeeded: 48,
> > Failed: 0,
> > Warnings: 0
> > 
> > scp upstream link:
> > 
https://patchwork.kernel.org/project/linux-mediatek/patch/20250811015922.32680-1-huayu.zong@mediatek.com/
> > 
> > Changes compared with v1:
> > --add v4l2-compliance test results
> > --add scp upstream link
> > --add HW difference discriptions for dt-bindings commit messages
> > 
> > This series patches dependent on:
> > [1]
> > 
https://patchwork.linuxtv.org/project/linux-media/cover/20250510075357.11761-1-yunfei.dong@mediatek.com/
> > [2]
> > 
https://patchwork.linuxtv.org/project/linux-media/cover/20250528063633.14054-1-irui.wang@mediatek.com/
> > 
> > Kyrie Wu (8):
> >   dt-bindings: media: mediatek: decoder: Add MT8189
> >     mediatek,vcodec-decoder
> >   media: mediatek: vcodec: add decoder compatible to support MT8189
> >   media: mediatek: vcodec: add profile and level supporting for
> > MT8189
> >   media: mediatek: vcodec: Add core-only VP9 decoding support for
> > MT8189
> >   media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2
> >   media: mediatek: vcodec: fix media device node number
> >   dt-bindings: media: Add MT8189 mediatek,vcodec-encoder
> >   media: mediatek: encoder: Add MT8189 encoder compatible data
> > 
> >  .../media/mediatek,vcodec-encoder.yaml        |  2 ++
> >  .../media/mediatek,vcodec-subdev-decoder.yaml |  1 +
> >  .../vcodec/decoder/mtk_vcodec_dec_drv.c       |  9 +++++-
> >  .../vcodec/decoder/mtk_vcodec_dec_drv.h       |  1 +
> >  .../vcodec/decoder/mtk_vcodec_dec_stateless.c |  4 +++
> >  .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 32 ++++++++++++---
> > ----
> >  .../vcodec/encoder/mtk_vcodec_enc_drv.c       | 14 ++++++++
> >  7 files changed, 50 insertions(+), 13 deletions(-)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/8] Enable video decoder & encoder for MT8189
  2025-08-11 14:43 ` [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Nicolas Dufresne
  2025-08-16  1:58   ` Kyrie Wu (吴晗)
@ 2025-08-19  8:26   ` Kyrie Wu (吴晗)
  2025-08-19 12:36     ` Nicolas Dufresne
  1 sibling, 1 reply; 17+ messages in thread
From: Kyrie Wu (吴晗) @ 2025-08-19  8:26 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	George Sun (孙林),
	Tiffany Lin (林慧珊), nhebert@chromium.org,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	mchehab@kernel.org, nicolas.dufresne@collabora.com,
	hverkuil@xs4all.nl, Kyrie Wu (吴晗),
	Yunfei Dong (董云飞), conor+dt@kernel.org,
	Irui Wang (王瑞), robh@kernel.org,
	sebastian.fricke@collabora.com,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	christophe.jaillet@wanadoo.fr, krzk+dt@kernel.org, arnd@arndb.de,
	Andrew-CT Chen (陳智迪),
	AngeloGioacchino Del Regno
  Cc: andrzejtp2010@gmail.com, neil.armstrong@linaro.org

On Mon, 2025-08-11 at 10:43 -0400, Nicolas Dufresne wrote:
> Hi,
> 
> Le lundi 11 août 2025 à 11:26 +0800, Kyrie Wu a écrit :
> > This series have the follow changing:
> > Firstly add mt8189 video decoder compatible, profile and level to
> > support
> > MT8189 kernel driver.
> > Secondly fix some bugs, including vp 4K profile2 and media device
> > node
> > number bug.
> > Lastly, add mt8189 video encoder compatible.
> > 
> > This series has been tested with MT8189 tast test.
> 
> As requested previously, please provide summary of the fluster tests
> results.
> This has been a requirement for quite some time now. This will serve
> as
> reference if this board get added to Kernel CI, which utilize fluster
> for
> decoder coverage. The tast tests are unfortunately bound to ChromeOS
> (or Android
> eventually as the first get decommission) and is very hard to
> reproduce with a
> mainline kernel.
> 
> regards,
> Nicolas

Dear Nicolas,

I have executed fluster test of H264 decoder, but all cases are failed.
However, I noticed that many bitstreams are used in both the tast and
fluster tests. The decoding tests for these bitstreams pass in the tast
test but fail in the fluster test. I compared the md5_checksum values
for these bitstreams in the xxx.json file and found them to be
completely different between the two tests.

The tast test results are recognized by Google. Based on the above
analysis, I believe the golden md5_checksum values in the fluster test
are incorrect.

Should I still need to attach all the fluster test results?

Thanks.

Regards,
Kyrie.
> 
> > Encoding and decoding worked for this chip.
> > 
> > Patches 1-2 Add decoder compatible.
> > Patches 3 Add profile and level supporting.
> > Patches 4 Add core-only VP9 decoding supporting.
> > Patches 5-6 fix some bugs.
> > Patches 7-8 Adds encoder compatible.
> > 
> > ---
> > v4l2-compliance test results:
> > v4l2-compliance -d /dev/video2
> > v4l2-compliance 1.28.1, 64 bits, 64-bit time_t
> > 
> > Compliance test for mtk-vcodec-enc device /dev/video2:
> > 
> > Driver Info:
> >         Driver name      : mtk-vcodec-enc
> >         Card type        : MT8189 video encoder
> >         Bus info         : platform:17020000.video-codec
> >         Driver version   : 6.6.88
> >         Capabilities     : 0x84204000
> >                 Video Memory-to-Memory Multiplanar
> >                 Streaming
> >                 Extended Pix Format
> >                 Device Capabilities
> >         Device Caps      : 0x04204000
> >                 Video Memory-to-Memory Multiplanar
> >                 Streaming
> >                 Extended Pix Format
> >         Detected Stateful Encoder
> > 
> > Required ioctls:
> >         test VIDIOC_QUERYCAP: OK
> >         test invalid ioctls: OK
> > 
> > Allow for multiple opens:
> >         test second /dev/video2 open: OK
> >         test VIDIOC_QUERYCAP: OK
> >         test VIDIOC_G/S_PRIORITY: OK
> >         test for unlimited opens: OK
> > 
> > Debug ioctls:
> >         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> >         test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> >         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> >         test VIDIOC_ENUMAUDIO: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDIO: OK (Not Supported)
> >         Inputs: 0 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> >         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> >         Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> >         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> >         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> >         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> >         test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls:
> >         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> >         test VIDIOC_QUERYCTRL: OK
> >         test VIDIOC_G/S_CTRL: OK
> >         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> >                 fail: v4l2-test-controls.cpp(1171): node-
> > >codec_mask &
> > STATEFUL_ENCODER
> >         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> >         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> >         Standard Controls: 16 Private Controls: 0
> > 
> > Format ioctls:
> >         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> >         test VIDIOC_G/S_PARM: OK
> >         test VIDIOC_G_FBUF: OK (Not Supported)
> >         test VIDIOC_G_FMT: OK
> >         test VIDIOC_TRY_FMT: OK
> >         test VIDIOC_S_FMT: OK
> >         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> >         test Cropping: OK
> >         test Composing: OK (Not Supported)
> >         test Scaling: OK (Not Supported)
> > 
> > Codec ioctls:
> >         test VIDIOC_(TRY_)ENCODER_CMD: OK
> >         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> >         test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> > 
> > Buffer ioctls:
> >         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> >         test CREATE_BUFS maximum buffers: OK
> >         test VIDIOC_REMOVE_BUFS: OK
> >         test VIDIOC_EXPBUF: OK
> >         test Requests: OK (Not Supported)
> > 
> > Total for mtk-vcodec-enc device /dev/video2: 47, Succeeded: 46,
> > Failed: 1,
> > Warnings: 0
> > 
> > v4l2-compliance -d /dev/video3
> > v4l2-compliance 1.28.1, 64 bits, 64-bit time_t
> > 
> > Compliance test for mtk-vcodec-dec device /dev/video3:
> > 
> > Driver Info:
> >         Driver name      : mtk-vcodec-dec
> >         Card type        : MT8189 video decoder
> >         Bus info         : platform:16000000.video-codec
> >         Driver version   : 6.6.88
> >         Capabilities     : 0x84204000
> >                 Video Memory-to-Memory Multiplanar
> >                 Streaming
> >                 Extended Pix Format
> >                 Device Capabilities
> >         Device Caps      : 0x04204000
> >                 Video Memory-to-Memory Multiplanar
> >                 Streaming
> >                 Extended Pix Format
> >         Detected Stateless Decoder
> > Media Driver Info:
> >         Driver name      : mtk-vcodec-dec
> >         Model            : mtk-vcodec-dec
> >         Serial           : 
> >         Bus info         : platform:16000000.video-codec
> >         Media version    : 6.6.88
> >         Hardware revision: 0x00000000 (0)
> >         Driver version   : 6.6.88
> > Interface Info:
> >         ID               : 0x0300000c
> >         Type             : V4L Video
> > Entity Info:
> >         ID               : 0x00000001 (1)
> >         Name             : mtk-vcodec-dec-source
> >         Function         : V4L2 I/O
> >         Pad 0x01000002   : 0: Source
> >           Link 0x02000008: to remote pad 0x1000004 of entity 'mtk-
> > vcodec-dec-
> > proc' (Video Decoder): Data, Enabled, Immutable
> > 
> > Required ioctls:
> >         test MC information (see 'Media Driver Info' above): OK
> >         test VIDIOC_QUERYCAP: OK
> >         test invalid ioctls: OK
> > 
> > Allow for multiple opens:
> >         test second /dev/video3 open: OK
> >         test VIDIOC_QUERYCAP: OK
> >         test VIDIOC_G/S_PRIORITY: OK
> >         test for unlimited opens: OK
> > 
> > Debug ioctls:
> >         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> >         test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> >         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> >         test VIDIOC_ENUMAUDIO: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDIO: OK (Not Supported)
> >         Inputs: 0 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> >         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> >         Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> >         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> >         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> >         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> >         test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls:
> >         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> >         test VIDIOC_QUERYCTRL: OK
> >         test VIDIOC_G/S_CTRL: OK
> >         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> >         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> >         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> >         Standard Controls: 15 Private Controls: 2
> >         Standard Compound Controls: 13 Private Compound Controls: 0
> > 
> > Format ioctls:
> >         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> >         test VIDIOC_G/S_PARM: OK (Not Supported)
> >         test VIDIOC_G_FBUF: OK (Not Supported)
> >         test VIDIOC_G_FMT: OK
> >         test VIDIOC_TRY_FMT: OK
> >         test VIDIOC_S_FMT: OK
> >         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> >         test Cropping: OK (Not Supported)
> >         test Composing: OK
> >         test Scaling: OK (Not Supported)
> > 
> > Codec ioctls:
> >         test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> >         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> >         test VIDIOC_(TRY_)DECODER_CMD: OK
> > 
> > Buffer ioctls:
> >         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> >         test CREATE_BUFS maximum buffers: OK
> >         test VIDIOC_REMOVE_BUFS: OK
> >         test VIDIOC_EXPBUF: OK
> >         test Requests: OK
> > 
> > Total for mtk-vcodec-dec device /dev/video3: 48, Succeeded: 48,
> > Failed: 0,
> > Warnings: 0
> > 
> > scp upstream link:
> > 
https://patchwork.kernel.org/project/linux-mediatek/patch/20250811015922.32680-1-huayu.zong@mediatek.com/
> > 
> > Changes compared with v1:
> > --add v4l2-compliance test results
> > --add scp upstream link
> > --add HW difference discriptions for dt-bindings commit messages
> > 
> > This series patches dependent on:
> > [1]
> > 
https://patchwork.linuxtv.org/project/linux-media/cover/20250510075357.11761-1-yunfei.dong@mediatek.com/
> > [2]
> > 
https://patchwork.linuxtv.org/project/linux-media/cover/20250528063633.14054-1-irui.wang@mediatek.com/
> > 
> > Kyrie Wu (8):
> >   dt-bindings: media: mediatek: decoder: Add MT8189
> >     mediatek,vcodec-decoder
> >   media: mediatek: vcodec: add decoder compatible to support MT8189
> >   media: mediatek: vcodec: add profile and level supporting for
> > MT8189
> >   media: mediatek: vcodec: Add core-only VP9 decoding support for
> > MT8189
> >   media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2
> >   media: mediatek: vcodec: fix media device node number
> >   dt-bindings: media: Add MT8189 mediatek,vcodec-encoder
> >   media: mediatek: encoder: Add MT8189 encoder compatible data
> > 
> >  .../media/mediatek,vcodec-encoder.yaml        |  2 ++
> >  .../media/mediatek,vcodec-subdev-decoder.yaml |  1 +
> >  .../vcodec/decoder/mtk_vcodec_dec_drv.c       |  9 +++++-
> >  .../vcodec/decoder/mtk_vcodec_dec_drv.h       |  1 +
> >  .../vcodec/decoder/mtk_vcodec_dec_stateless.c |  4 +++
> >  .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 32 ++++++++++++---
> > ----
> >  .../vcodec/encoder/mtk_vcodec_enc_drv.c       | 14 ++++++++
> >  7 files changed, 50 insertions(+), 13 deletions(-)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/8] Enable video decoder & encoder for MT8189
  2025-08-19  8:26   ` Kyrie Wu (吴晗)
@ 2025-08-19 12:36     ` Nicolas Dufresne
  0 siblings, 0 replies; 17+ messages in thread
From: Nicolas Dufresne @ 2025-08-19 12:36 UTC (permalink / raw)
  To: Kyrie Wu (吴晗), linux-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org, George Sun (孙林),
	Tiffany Lin (林慧珊), nhebert@chromium.org,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	mchehab@kernel.org, hverkuil@xs4all.nl,
	Yunfei Dong (董云飞), conor+dt@kernel.org,
	Irui Wang (王瑞), robh@kernel.org,
	sebastian.fricke@collabora.com,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	christophe.jaillet@wanadoo.fr, krzk+dt@kernel.org, arnd@arndb.de,
	Andrew-CT Chen (陳智迪),
	AngeloGioacchino Del Regno
  Cc: andrzejtp2010@gmail.com, neil.armstrong@linaro.org, yunfei.dong

[-- Attachment #1: Type: text/plain, Size: 15017 bytes --]

Dear Kyrie,

Le mardi 19 août 2025 à 08:26 +0000, Kyrie Wu (吴晗) a écrit :
> On Mon, 2025-08-11 at 10:43 -0400, Nicolas Dufresne wrote:
> > Hi,
> > 
> > Le lundi 11 août 2025 à 11:26 +0800, Kyrie Wu a écrit :
> > > This series have the follow changing:
> > > Firstly add mt8189 video decoder compatible, profile and level to
> > > support
> > > MT8189 kernel driver.
> > > Secondly fix some bugs, including vp 4K profile2 and media device
> > > node
> > > number bug.
> > > Lastly, add mt8189 video encoder compatible.
> > > 
> > > This series has been tested with MT8189 tast test.
> > 
> > As requested previously, please provide summary of the fluster tests
> > results.
> > This has been a requirement for quite some time now. This will serve
> > as
> > reference if this board get added to Kernel CI, which utilize fluster
> > for
> > decoder coverage. The tast tests are unfortunately bound to ChromeOS
> > (or Android
> > eventually as the first get decommission) and is very hard to
> > reproduce with a
> > mainline kernel.
> > 
> > regards,
> > Nicolas
> 
> Dear Nicolas,
> 
> I have executed fluster test of H264 decoder, but all cases are failed.
> However, I noticed that many bitstreams are used in both the tast and
> fluster tests. The decoding tests for these bitstreams pass in the tast
> test but fail in the fluster test. I compared the md5_checksum values
> for these bitstreams in the xxx.json file and found them to be
> completely different between the two tests.
> 
> The tast test results are recognized by Google. Based on the above
> analysis, I believe the golden md5_checksum values in the fluster test
> are incorrect.
> 
> Should I still need to attach all the fluster test results?

The requirement are the same for all submitters, You likely have a problem in
your test setup. Other Mediatek developers have successfully run through this
test using GStreamer as a backend, I also accept results using ffmpeg backend
with LibreELEC patches, or other backend upstreamed into fluster. Google did
wrote a decoder utilizing the Chromium internals, but devs left before this was
made upstream fluster.

I believe you can seek help from Yunfei Dong <yunfei.dong@mediatek.com> who
successfully provided these results on many other variants. I believe he used a
Debian testing root file system for that purpose since ChromeOS Gentoo fork was
too old (and now in maintenance only mode).

If you want support from this mailing list, make sure to describe how it failed,
and show that you have investigated the problems, and how far you have gone
through it. At the very minimum you should have visually inspected the raw
output using the -k (keep) command line option on at least one of the stream.

regards,
Nicolas

> 
> Thanks.
> 
> Regards,
> Kyrie.
> > 
> > > Encoding and decoding worked for this chip.
> > > 
> > > Patches 1-2 Add decoder compatible.
> > > Patches 3 Add profile and level supporting.
> > > Patches 4 Add core-only VP9 decoding supporting.
> > > Patches 5-6 fix some bugs.
> > > Patches 7-8 Adds encoder compatible.
> > > 
> > > ---
> > > v4l2-compliance test results:
> > > v4l2-compliance -d /dev/video2
> > > v4l2-compliance 1.28.1, 64 bits, 64-bit time_t
> > > 
> > > Compliance test for mtk-vcodec-enc device /dev/video2:
> > > 
> > > Driver Info:
> > >         Driver name      : mtk-vcodec-enc
> > >         Card type        : MT8189 video encoder
> > >         Bus info         : platform:17020000.video-codec
> > >         Driver version   : 6.6.88
> > >         Capabilities     : 0x84204000
> > >                 Video Memory-to-Memory Multiplanar
> > >                 Streaming
> > >                 Extended Pix Format
> > >                 Device Capabilities
> > >         Device Caps      : 0x04204000
> > >                 Video Memory-to-Memory Multiplanar
> > >                 Streaming
> > >                 Extended Pix Format
> > >         Detected Stateful Encoder
> > > 
> > > Required ioctls:
> > >         test VIDIOC_QUERYCAP: OK
> > >         test invalid ioctls: OK
> > > 
> > > Allow for multiple opens:
> > >         test second /dev/video2 open: OK
> > >         test VIDIOC_QUERYCAP: OK
> > >         test VIDIOC_G/S_PRIORITY: OK
> > >         test for unlimited opens: OK
> > > 
> > > Debug ioctls:
> > >         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> > >         test VIDIOC_LOG_STATUS: OK (Not Supported)
> > > 
> > > Input ioctls:
> > >         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> > >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > >         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> > >         test VIDIOC_ENUMAUDIO: OK (Not Supported)
> > >         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> > >         test VIDIOC_G/S_AUDIO: OK (Not Supported)
> > >         Inputs: 0 Audio Inputs: 0 Tuners: 0
> > > 
> > > Output ioctls:
> > >         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> > >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > >         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> > >         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> > >         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> > >         Outputs: 0 Audio Outputs: 0 Modulators: 0
> > > 
> > > Input/Output configuration ioctls:
> > >         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> > >         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> > >         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> > >         test VIDIOC_G/S_EDID: OK (Not Supported)
> > > 
> > > Control ioctls:
> > >         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> > >         test VIDIOC_QUERYCTRL: OK
> > >         test VIDIOC_G/S_CTRL: OK
> > >         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> > >                 fail: v4l2-test-controls.cpp(1171): node-
> > > > codec_mask &
> > > STATEFUL_ENCODER
> > >         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> > >         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> > >         Standard Controls: 16 Private Controls: 0
> > > 
> > > Format ioctls:
> > >         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> > >         test VIDIOC_G/S_PARM: OK
> > >         test VIDIOC_G_FBUF: OK (Not Supported)
> > >         test VIDIOC_G_FMT: OK
> > >         test VIDIOC_TRY_FMT: OK
> > >         test VIDIOC_S_FMT: OK
> > >         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> > >         test Cropping: OK
> > >         test Composing: OK (Not Supported)
> > >         test Scaling: OK (Not Supported)
> > > 
> > > Codec ioctls:
> > >         test VIDIOC_(TRY_)ENCODER_CMD: OK
> > >         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> > >         test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> > > 
> > > Buffer ioctls:
> > >         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> > >         test CREATE_BUFS maximum buffers: OK
> > >         test VIDIOC_REMOVE_BUFS: OK
> > >         test VIDIOC_EXPBUF: OK
> > >         test Requests: OK (Not Supported)
> > > 
> > > Total for mtk-vcodec-enc device /dev/video2: 47, Succeeded: 46,
> > > Failed: 1,
> > > Warnings: 0
> > > 
> > > v4l2-compliance -d /dev/video3
> > > v4l2-compliance 1.28.1, 64 bits, 64-bit time_t
> > > 
> > > Compliance test for mtk-vcodec-dec device /dev/video3:
> > > 
> > > Driver Info:
> > >         Driver name      : mtk-vcodec-dec
> > >         Card type        : MT8189 video decoder
> > >         Bus info         : platform:16000000.video-codec
> > >         Driver version   : 6.6.88
> > >         Capabilities     : 0x84204000
> > >                 Video Memory-to-Memory Multiplanar
> > >                 Streaming
> > >                 Extended Pix Format
> > >                 Device Capabilities
> > >         Device Caps      : 0x04204000
> > >                 Video Memory-to-Memory Multiplanar
> > >                 Streaming
> > >                 Extended Pix Format
> > >         Detected Stateless Decoder
> > > Media Driver Info:
> > >         Driver name      : mtk-vcodec-dec
> > >         Model            : mtk-vcodec-dec
> > >         Serial           : 
> > >         Bus info         : platform:16000000.video-codec
> > >         Media version    : 6.6.88
> > >         Hardware revision: 0x00000000 (0)
> > >         Driver version   : 6.6.88
> > > Interface Info:
> > >         ID               : 0x0300000c
> > >         Type             : V4L Video
> > > Entity Info:
> > >         ID               : 0x00000001 (1)
> > >         Name             : mtk-vcodec-dec-source
> > >         Function         : V4L2 I/O
> > >         Pad 0x01000002   : 0: Source
> > >           Link 0x02000008: to remote pad 0x1000004 of entity 'mtk-
> > > vcodec-dec-
> > > proc' (Video Decoder): Data, Enabled, Immutable
> > > 
> > > Required ioctls:
> > >         test MC information (see 'Media Driver Info' above): OK
> > >         test VIDIOC_QUERYCAP: OK
> > >         test invalid ioctls: OK
> > > 
> > > Allow for multiple opens:
> > >         test second /dev/video3 open: OK
> > >         test VIDIOC_QUERYCAP: OK
> > >         test VIDIOC_G/S_PRIORITY: OK
> > >         test for unlimited opens: OK
> > > 
> > > Debug ioctls:
> > >         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> > >         test VIDIOC_LOG_STATUS: OK (Not Supported)
> > > 
> > > Input ioctls:
> > >         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> > >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > >         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> > >         test VIDIOC_ENUMAUDIO: OK (Not Supported)
> > >         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> > >         test VIDIOC_G/S_AUDIO: OK (Not Supported)
> > >         Inputs: 0 Audio Inputs: 0 Tuners: 0
> > > 
> > > Output ioctls:
> > >         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> > >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > >         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> > >         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> > >         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> > >         Outputs: 0 Audio Outputs: 0 Modulators: 0
> > > 
> > > Input/Output configuration ioctls:
> > >         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> > >         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> > >         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> > >         test VIDIOC_G/S_EDID: OK (Not Supported)
> > > 
> > > Control ioctls:
> > >         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> > >         test VIDIOC_QUERYCTRL: OK
> > >         test VIDIOC_G/S_CTRL: OK
> > >         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> > >         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> > >         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> > >         Standard Controls: 15 Private Controls: 2
> > >         Standard Compound Controls: 13 Private Compound Controls: 0
> > > 
> > > Format ioctls:
> > >         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> > >         test VIDIOC_G/S_PARM: OK (Not Supported)
> > >         test VIDIOC_G_FBUF: OK (Not Supported)
> > >         test VIDIOC_G_FMT: OK
> > >         test VIDIOC_TRY_FMT: OK
> > >         test VIDIOC_S_FMT: OK
> > >         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> > >         test Cropping: OK (Not Supported)
> > >         test Composing: OK
> > >         test Scaling: OK (Not Supported)
> > > 
> > > Codec ioctls:
> > >         test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> > >         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> > >         test VIDIOC_(TRY_)DECODER_CMD: OK
> > > 
> > > Buffer ioctls:
> > >         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> > >         test CREATE_BUFS maximum buffers: OK
> > >         test VIDIOC_REMOVE_BUFS: OK
> > >         test VIDIOC_EXPBUF: OK
> > >         test Requests: OK
> > > 
> > > Total for mtk-vcodec-dec device /dev/video3: 48, Succeeded: 48,
> > > Failed: 0,
> > > Warnings: 0
> > > 
> > > scp upstream link:
> > > 
> https://patchwork.kernel.org/project/linux-mediatek/patch/20250811015922.32680-1-huayu.zong@mediatek.com/
> > > 
> > > Changes compared with v1:
> > > --add v4l2-compliance test results
> > > --add scp upstream link
> > > --add HW difference discriptions for dt-bindings commit messages
> > > 
> > > This series patches dependent on:
> > > [1]
> > > 
> https://patchwork.linuxtv.org/project/linux-media/cover/20250510075357.11761-1-yunfei.dong@mediatek.com/
> > > [2]
> > > 
> https://patchwork.linuxtv.org/project/linux-media/cover/20250528063633.14054-1-irui.wang@mediatek.com/
> > > 
> > > Kyrie Wu (8):
> > >   dt-bindings: media: mediatek: decoder: Add MT8189
> > >     mediatek,vcodec-decoder
> > >   media: mediatek: vcodec: add decoder compatible to support MT8189
> > >   media: mediatek: vcodec: add profile and level supporting for
> > > MT8189
> > >   media: mediatek: vcodec: Add core-only VP9 decoding support for
> > > MT8189
> > >   media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2
> > >   media: mediatek: vcodec: fix media device node number
> > >   dt-bindings: media: Add MT8189 mediatek,vcodec-encoder
> > >   media: mediatek: encoder: Add MT8189 encoder compatible data
> > > 
> > >  .../media/mediatek,vcodec-encoder.yaml        |  2 ++
> > >  .../media/mediatek,vcodec-subdev-decoder.yaml |  1 +
> > >  .../vcodec/decoder/mtk_vcodec_dec_drv.c       |  9 +++++-
> > >  .../vcodec/decoder/mtk_vcodec_dec_drv.h       |  1 +
> > >  .../vcodec/decoder/mtk_vcodec_dec_stateless.c |  4 +++
> > >  .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 32 ++++++++++++---
> > > ----
> > >  .../vcodec/encoder/mtk_vcodec_enc_drv.c       | 14 ++++++++
> > >  7 files changed, 50 insertions(+), 13 deletions(-)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-08-19 12:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11  3:26 [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Kyrie Wu
2025-08-11  3:26 ` [PATCH v2 1/8] dt-bindings: media: mediatek: decoder: Add MT8189 mediatek,vcodec-decoder Kyrie Wu
2025-08-11  8:07   ` Krzysztof Kozlowski
2025-08-16  1:47     ` Kyrie Wu (吴晗)
2025-08-11  3:26 ` [PATCH v2 2/8] media: mediatek: vcodec: add decoder compatible to support MT8189 Kyrie Wu
2025-08-11  3:26 ` [PATCH v2 3/8] media: mediatek: vcodec: add profile and level supporting for MT8189 Kyrie Wu
2025-08-11  3:26 ` [PATCH v2 4/8] media: mediatek: vcodec: Add core-only VP9 decoding support " Kyrie Wu
2025-08-11  3:26 ` [PATCH v2 5/8] media: mediatek: vcodec: fix vp9 4096x2176 fail for profile2 Kyrie Wu
2025-08-11  3:26 ` [PATCH v2 6/8] media: mediatek: vcodec: fix media device node number Kyrie Wu
2025-08-11  3:26 ` [PATCH v2 7/8] dt-bindings: media: Add MT8189 mediatek,vcodec-encoder Kyrie Wu
2025-08-11  8:07   ` Krzysztof Kozlowski
2025-08-16  1:54     ` Kyrie Wu (吴晗)
2025-08-11  3:26 ` [PATCH v2 8/8] media: mediatek: encoder: Add MT8189 encoder compatible data Kyrie Wu
2025-08-11 14:43 ` [PATCH v2 0/8] Enable video decoder & encoder for MT8189 Nicolas Dufresne
2025-08-16  1:58   ` Kyrie Wu (吴晗)
2025-08-19  8:26   ` Kyrie Wu (吴晗)
2025-08-19 12:36     ` Nicolas Dufresne

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).