[PATCH v8 0/9] Enable video decoder & encoder for MT8189

Kyrie Wu posted 9 patches 1 week, 5 days ago
.../media/mediatek,vcodec-encoder.yaml        |   2 +
.../media/mediatek,vcodec-subdev-decoder.yaml |   5 +-
.../mediatek/vcodec/decoder/mtk_vcodec_dec.c  |   2 +-
.../mediatek/vcodec/decoder/mtk_vcodec_dec.h  |   6 +
.../vcodec/decoder/mtk_vcodec_dec_drv.c       |  46 ++--
.../vcodec/decoder/mtk_vcodec_dec_drv.h       |  35 ++-
.../vcodec/decoder/mtk_vcodec_dec_hw.c        |   2 +-
.../vcodec/decoder/mtk_vcodec_dec_stateful.c  |  14 +
.../vcodec/decoder/mtk_vcodec_dec_stateless.c | 239 ++++++++++++------
.../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c |  14 +-
.../vcodec/encoder/mtk_vcodec_enc_drv.c       |  14 +
11 files changed, 253 insertions(+), 126 deletions(-)
[PATCH v8 0/9] Enable video decoder & encoder for MT8189
Posted by Kyrie Wu 1 week, 5 days ago
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 Add decoder compatible.
Patches 1 fix decoder chip model.
Patches 3-4 Add profile, level and probability size supporting.
Patches 6 add decoder platform data to support MT8189.
Patches 5 & 7 fix some bugs.
Patches 8-9 Adds encoder compatible.

---
H264 test results:
./fluster.py run -d GStreamer-H.264-V4L2SL-Gst1.0 -j2 -t 90
    JVT-AVC_V1	Ran 96/135 tests successfully

VP9 test results:
./fluster.py run -d GStreamer-VP9-V4L2SL-Gst1.0 -j2 -t 90
	VP9-TEST-VECTORS	Ran 276/305 tests successfully

v4l2-compliance test results:
Compliance test for mtk-vcodec-enc device /dev/video2:
Total for mtk-vcodec-enc device /dev/video2: 47, Succeeded: 46, Failed: 1, Warnings: 0
Compliance test for mtk-vcodec-dec device /dev/video3:
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/
dtsi upstream link:
https://lore.kernel.org/linux-mediatek/20251030134541.784011-12-jh.hsu@mediatek.com/T/#m847e35de0a5b18fac0ca0624a8559d84964ad5c7

Changes compared with v7:
--relocate the patches set
--refactor decoder platform data patch
--fix commit message errors

Changes compared with v6:
--refactor the patches of set compatible data, profile and level
--add reviewer to commit messages
--fix commit message errors

Changes compared with v5:
--refactor the patches of set compatible data, profile and level
--add reviewer to commit messages
--fix commit message errors

Changes compared with v4:
--update H264 & vp9 fluster test results
--update vp9 single core decoder prob size setting and commit messages

Changes compared with v3:
--add reviewer to commit messages
--Rebased on top of the latest media tree

Changes compared with v2:
--add H264 fluster test results
--reorder compatible string for dt-bindings

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/patch/20260211054149.27249-2-yunfei.dong@mediatek.com/
[2]
https://patchwork.linuxtv.org/project/linux-media/patch/20260302035244.8994-2-irui.wang@mediatek.com/

Kyrie Wu (9):
  dt-bindings: media: mediatek: decoder: Add MT8189
    mediatek,vcodec-decoder
  media: mediatek: decoder: Add a new platform data member
  media: mediatek: vcodec: Refactor Decoder profile & level Handling
  media: mediatek: vcodec: Add VP9 Probability Size Configuration
  media: mediatek: vcodec: Fix vp9 4096x2176 fail for profile2
  media: mediatek: vcodec: add decoder compatible to support MT8189
  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 |   5 +-
 .../mediatek/vcodec/decoder/mtk_vcodec_dec.c  |   2 +-
 .../mediatek/vcodec/decoder/mtk_vcodec_dec.h  |   6 +
 .../vcodec/decoder/mtk_vcodec_dec_drv.c       |  46 ++--
 .../vcodec/decoder/mtk_vcodec_dec_drv.h       |  35 ++-
 .../vcodec/decoder/mtk_vcodec_dec_hw.c        |   2 +-
 .../vcodec/decoder/mtk_vcodec_dec_stateful.c  |  14 +
 .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 239 ++++++++++++------
 .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c |  14 +-
 .../vcodec/encoder/mtk_vcodec_enc_drv.c       |  14 +
 11 files changed, 253 insertions(+), 126 deletions(-)

-- 
2.45.2
Re: [PATCH v8 0/9] Enable video decoder & encoder for MT8189
Posted by Nicolas Dufresne 1 week, 5 days ago
Kyrie, Yunfei, Irui,

Le vendredi 20 mars 2026 à 13:59 +0800, Kyrie Wu a écrit :
> 
[...]
> This series patches dependent on:
> [1]
> https://patchwork.linuxtv.org/project/linux-media/patch/20260211054149.27249-2-yunfei.dong@mediatek.com/
> [2]
> https://patchwork.linuxtv.org/project/linux-media/patch/20260302035244.8994-2-irui.wang@mediatek.com/

While this one is now ready, it still can't be merge, because the other series
it depends one have not been updated to use the pdata properly. In fact, its
quite likely that some of the patches in this serie must be moved up the chain.
This type of linked submission is making my life extremely difficult, and causes
massive delays.

Basically, in a chain of 3 series (and probably 4 since the first one does not
apply), the refactoring that causes all the series to not be accepted is
happening in the third one. Angelo and I have been clear for weeks, if you need
a constant value for a platform, it goes in the platform data. Don't do switch
of strcmp at runtime, these are constants and we already did string matching to
in the probe to find this pdata. Once the missing data is added, simply make a
final patch adding the pdata structure for the platform. Use this v8 of the
MT8189 support as reference, it is as I said ready, but it does not apply due to
broken dependencies.

I can't easily fix this, so please work together, synchronize your submissions
so that we can get the MT8196 and MT8189 support finally merged.

regards,
Nicolas
Re: [PATCH v8 0/9] Enable video decoder & encoder for MT8189
Posted by Kyrie Wu (吴晗) 1 week, 2 days ago
On Fri, 2026-03-20 at 09:10 -0400, Nicolas Dufresne wrote:
> Kyrie, Yunfei, Irui,
> 
> Le vendredi 20 mars 2026 à 13:59 +0800, Kyrie Wu a écrit :
> > 
> 
> [...]
> > This series patches dependent on:
> > [1]
> > 
https://patchwork.linuxtv.org/project/linux-media/patch/20260211054149.27249-2-yunfei.dong@mediatek.com/
> > [2]
> > 
https://patchwork.linuxtv.org/project/linux-media/patch/20260302035244.8994-2-irui.wang@mediatek.com/
> 
> While this one is now ready, it still can't be merge, because the
> other series
> it depends one have not been updated to use the pdata properly. In
> fact, its
> quite likely that some of the patches in this serie must be moved up
> the chain.
> This type of linked submission is making my life extremely difficult,
> and causes
> massive delays.
> 
> Basically, in a chain of 3 series (and probably 4 since the first one
> does not
> apply), the refactoring that causes all the series to not be accepted
> is
> happening in the third one. Angelo and I have been clear for weeks,
> if you need
> a constant value for a platform, it goes in the platform data. Don't
> do switch
> of strcmp at runtime, these are constants and we already did string
> matching to
> in the probe to find this pdata. Once the missing data is added,
> simply make a
> final patch adding the pdata structure for the platform. Use this v8
> of the
> MT8189 support as reference, it is as I said ready, but it does not
> apply due to
> broken dependencies.
> 
> I can't easily fix this, so please work together, synchronize your
> submissions
> so that we can get the MT8196 and MT8189 support finally merged.
> 
> regards,
> Nicolas

Dear Nicolas,

Thank you very much for your detailed feedback and patient guidance on
our patch series.
We greatly appreciate the time and effort you have dedicated to
reviewing our submissions.
We fully understand your concerns regarding the dependency and
structural issues between the patch series.

Allow me to explain our current situation and development timeline:
The MT8196 platform development was initiated earlier than MT8189, and
during its development cycle,
several critical bug fixes were implemented in the MT8196 patchset.
These fixes are essential
for the stability and proper functioning of the vcodec driver.
If we were to bypass the MT8196 patches and directly rebase the MT8189
patches for upstream submission,
the vcodec driver would unfortunately inherit these unresolved bugs. On
the other hand,
if we were to incorporate all the bug fixes from MT8196 into the MT8189
patchset,
it would create a mixture of both MT8196 and MT8189 changes, which
would not be a clean
or maintainable solution and goes against proper upstream practices.

Given this dependency chain, we believe the most appropriate path
forward is to prioritize
completing the MT8196 patch upstream work first. Our team is fully
committed to putting our best efforts
into expediting the MT8196 patch series review and revision process.
Once those patches are successfully merged,
the MT8189 series can then proceed cleanly without these structural
concerns.

We sincerely appreciate your expertise and the constructive guidance
you have provided throughout this process.
Your feedback has been invaluable in helping us understand the
expectations and proper upstream practices.
We commit to diligently addressing all review comments and working
closely with you to ensure
our patches meet the required standards.

Thank you once again for your patience and support. We look forward to
continuing our collaboration
and delivering high-quality patches that benefit the community.

Best regards,
Kyrie