[PATCH v2 00/12] Enable jpeg enc & dec multi-hardwares for MT8196

kyrie.wu
2025-04-10T06:42:15Z

This series adds support for mt8196 multi-hardwares jpeg enc & dec,
by first adding mt8196 jpegdec and jpegenc compatible to install
kernel driver. Add smmu setting to support smmu and iommu at the
same time.
Secondly refactor buffer and clock setting to support multi-hw jpeg
working.
Lastly, fix some bugs, including resolution change handleing, stop
streaming sw flow and others.

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

Patches 1-3 Adds jpeg encoder and decoder compatible.
Patches 4 add jpeg smmu sid setting.
Patches 5 fix jpeg hw count setting to support different chips.
Patches 6 refactor jpeg buffer payload setting to handle buffer
size bug while resolution changed.
Patches 7 reconstruct jpeg dst buffer layout.
Patches 8 fix multi-core stop streaming flow
Patches 9 refactor multi-core clk suspend/resume setting
Patches 10 fix decoding buffer number setting timing issue
Patches 11 refactor decoding resolution change operation
Patches 12 fix remove buffer operation

---
This series patches dependent on:
[1]
https://patchwork.kernel.org/project/linux-mediatek/patch/20240808092555.12999-1-jianhua.lin@mediatek.com/

Changes compared with v1:
--refine jpeg dt-bindings for MT8196
--optimize software code to manage jpeg HW count
--refactor smmu sid setting function interface
--Some modifications for patch v1's review comments.

kyrie.wu (12):
dt-bindings: mediatek: Add mediatek, mt8196-jpgdec compatible
dt-bindings: mediatek: Add mediatek, mt8196-jpgenc compatible
media: mediatek: jpeg: add jpeg compatible
media: mediatek: jpeg: add jpeg smmu sid setting
media: mediatek: jpeg: fix jpeg hw count setting
media: mediatek: jpeg: refactor jpeg buffer payload setting
media: mediatek: jpeg: refactor jpeg dst buffer layout
media: mediatek: jpeg: fix stop streaming flow for multi-core
media: mediatek: jpeg: refactor multi-core clk suspend and resume
setting
media: mediatek: jpeg: fix decoding buffer number setting timing issue
media: mediatek: jpeg: refactor decoding resolution change operation
media: mediatek: jpeg: fix remove buffer operation for multi-core

.../media/mediatek,mt8195-jpegdec.yaml | 8 +-
.../media/mediatek,mt8195-jpegenc.yaml | 8 +-
.../platform/mediatek/jpeg/mtk_jpeg_core.c | 166 +++++++++++++-----
.../platform/mediatek/jpeg/mtk_jpeg_core.h | 25 ++-
.../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 113 +++++++++++-
.../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 114 +++++++++++-
6 files changed, 381 insertions(+), 53 deletions(-)

--
2.46.0