mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyrie Wu <kyrie.wu@mediatek.com>
To: Tiffany Lin <tiffany.lin@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	Yunfei Dong <yunfei.dong@mediatek.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Kyrie Wu <kyrie.wu@mediatek.com>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Ricardo Ribalda <ribalda@chromium.org>,
	Kees Cook <kees@kernel.org>,
	Hans Verkuil <hverkuil+cisco@kernel.org>,
	Fei Shao <fshao@chromium.org>,
	Haoxiang Li <haoxiang_li2024@163.com>,
	Chen-Yu Tsai <wenst@chromium.org>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Tomasz Figa <tfiga@chromium.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Benjamin Gaignard <benjamin.gaignard@collabora.com>,
	Qianfeng Rong <rongqianfeng@vivo.com>,
	Irui Wang <irui.wang@mediatek.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Fan Wu <fanwu01@zju.edu.cn>, <linux-media@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: [PATCH v9 00/14] media: mediatek: vcodec: support video decoder in mt8196
Date: Tue, 17 Nov 2026 11:29:36 +0800	[thread overview]
Message-ID: <20261117032950.1425556-1-kyrie.wu@mediatek.com> (raw)

From: Kyrie Wu <kyrie.wu@mediatek.com>

This patch set adds support for the video decoder on the MediaTek MT8196
platform, leveraging the VCP microprocessor for enhanced performance. It
introduces new firmware interfaces for kernel-side communication with VCP,
adds MT8196 compatible, codec levels/profiles, and private data. Rewrites
the AV1 driver to support extended VSI structures, then change irq table
and cdf table size.

This patch set depends on "Add MediaTek VCP remoteproc driver support"[1]

[1] https://patchwork.kernel.org/project/linux-mediatek/cover/20260427111446.22955-1-xiangzhi.tang@mediatek.com/

Compliance Test Result:
- v4l2-compliance: 48/49 tests passed, 1 failed (known issue)
- fail: v4l2-test-controls.cpp(981): ret (got 13)
-        test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL

Fluster Test Result:
- H264:
- Ran 95/135 tests successfully   in 73.540 secs
- H265:
- Ran 142/147 tests successfully  in 100.168 secs
- VP9:
- Ran 276/305 tests successfully  in 106.804 secs
- AV1:
- Ran 240/242 tests successfully  in 23.991 secs

Changed in v9:
- Rebased on mainline 23c62304dde29abe92013d85910d03a77dada35d with the
  seven-patch VCP dependency [1] applied first.
- Patch 2: release the VCP reference even if feature deregistration fails,
  print the shared DMA address with %pad, and remove unused probe locals.
- Patch 7: preserve the 16-byte legacy VPU/SCP INIT message while sending
  the extended 24-byte INIT message, including shared_iova, to VCP.
- Patch 8: constrain MT8196 decoder children to exactly four clocks and
  update the binding subject and VCP/SCP description per review.
- Patch 14: save the validated remote AV1 VSI length and use it for both
  LAT and CORE outgoing copies.

Changed in v8:
- Rebased on Linux master at 3857c2f.
- Update patch 8/14's subject and describe VCP as the coprocessor running
  the video decoder firmware, per Rob Herring's review.

Changed in v7:
- Rebased on top of the latest media tree
- Update the MT8196 decoder binding to require VCP, reject SCP, and validate
  the four fixed hardware clock names on each decoder child node.

Changed in v6:
- Rebase to latest codebase
- Change patch authors and Signed-off-by trailers to Kyrie Wu
- Use safer firmware selection flow for decoder and encoder initialization
- Add VCP IPI id validation and keep invalid messages from stopping the
  message processing thread
- Fix VCP ACK state handling, stale ACK handling, and interruptible ACK wait
  retry handling
- Stop the VCP message thread, unregister callbacks, and release the VCP
  remoteproc reference during cleanup
- Replace VCP readiness busy-wait polling with sleepable polling
- Add VCP encoder capability callback
- Fix MT2110R debug output string
- Update the MT8196 decoder binding commit message according to review
- Keep MT8196 compatible definition before patches that use it
- Fill AV1 reference C plane buffer size

Changed in v5:
- Rebase to latest codebase
- Move vcp init method to driver pdata structures
- change decoder dt-bindings patch's commit message
- MT8189 base on MT8196 patch set

Changed in v4:
- Rebase to latest codebase
- Move dt-bindings and compatible to the after of vcp driver ready
- MT8189 base on MT8196 patch set

Changed in v3:
- Depends on change no update
- Add Compliance and Fluster test result
- Re-write the commit message for patch 12
- Change the patches according to review suggestion for patch: 3/4/5/6/14

Changed in v2:
- re-write the commit message for patch 1

Kyrie Wu (14):
  media: mediatek: vcodec: support vcp architecture
  media: mediatek: vcodec: add driver to support vcp
  media: mediatek: vcodec: add driver to support vcp encoder
  media: mediatek: vcodec: get different firmware ipi id
  media: mediatek: vcodec: get share memory address
  media: mediatek: vcodec: add debug information
  media: mediatek: vcodec: send share memory address to vcp
  media: dt-bindings: mediatek,vcodec-subdev-decoder: Add MT8196
  media: mediatek: vcodec: add decoder compatible to support mt8196
  media: mediatek: vcodec: define MT8196 vcodec levels.
  media: mediatek: vcodec: support 36bit iova address
  media: mediatek: vcodec: clean xpc status
  media: mediatek: decoder: fill av1 buffer size with picinfo
  media: mediatek: decoder: support av1 extend vsi

 .../media/mediatek,vcodec-subdev-decoder.yaml |  52 +-
 .../media/platform/mediatek/vcodec/Kconfig    |   4 +
 .../platform/mediatek/vcodec/common/Makefile  |   4 +
 .../mediatek/vcodec/common/mtk_vcodec_dbgfs.c |  21 +-
 .../mediatek/vcodec/common/mtk_vcodec_fw.c    |  33 +-
 .../mediatek/vcodec/common/mtk_vcodec_fw.h    |   8 +-
 .../vcodec/common/mtk_vcodec_fw_priv.h        |  12 +
 .../vcodec/common/mtk_vcodec_fw_scp.c         |   1 +
 .../vcodec/common/mtk_vcodec_fw_vcp.c         | 631 ++++++++++++++++++
 .../vcodec/common/mtk_vcodec_fw_vcp.h         | 166 +++++
 .../vcodec/common/mtk_vcodec_fw_vpu.c         |   1 +
 .../vcodec/decoder/mtk_vcodec_dec_drv.c       |  23 +-
 .../vcodec/decoder/mtk_vcodec_dec_drv.h       |   3 +
 .../vcodec/decoder/mtk_vcodec_dec_hw.c        |  31 +
 .../vcodec/decoder/mtk_vcodec_dec_hw.h        |  13 +-
 .../vcodec/decoder/mtk_vcodec_dec_stateless.c |   6 +
 .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 126 +++-
 .../decoder/vdec/vdec_h264_req_multi_if.c     |  11 +-
 .../decoder/vdec/vdec_hevc_req_multi_if.c     |  12 +-
 .../vcodec/decoder/vdec/vdec_vp8_req_if.c     |   5 +-
 .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c |  27 +-
 .../mediatek/vcodec/decoder/vdec_ipi_msg.h    |   2 +
 .../mediatek/vcodec/decoder/vdec_vpu_if.c     |  19 +-
 .../mediatek/vcodec/encoder/mtk_vcodec_enc.c  |   1 -
 .../mediatek/vcodec/encoder/mtk_vcodec_enc.h  |   2 +
 .../vcodec/encoder/mtk_vcodec_enc_drv.c       |   7 +-
 .../vcodec/encoder/mtk_vcodec_enc_drv.h       |   2 +
 27 files changed, 1156 insertions(+), 67 deletions(-)
 create mode 100644 drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vcp.c
 create mode 100644 drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vcp.h


base-commit: 23c62304dde29abe92013d85910d03a77dada35d
prerequisite-patch-id: 9f5a680ff9c58918d53c09c15d48e6ac33c643fc
prerequisite-patch-id: af540a1d2093ff0b635f96f3257fbf768302925e
prerequisite-patch-id: dee8633604fd7528e9ebcb9de25a3e42231f1f80
prerequisite-patch-id: f464ff9a2860b4fc07c051961e26c10047a1731d
prerequisite-patch-id: 1b9295ecd3895c60f6d5ab690f9c05987e1a551f
prerequisite-patch-id: a4abfe16fb9cfd55e44707491259f72f50783a33
prerequisite-patch-id: 472784c2603c63038b064dd36d867b9105a23eda
-- 
2.51.0.windows.2


             reply	other threads:[~2026-11-17  3:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  3:29 Kyrie Wu [this message]
2026-11-17  3:29 ` [PATCH v9 01/14] media: mediatek: vcodec: support vcp architecture Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 02/14] media: mediatek: vcodec: add driver to support vcp Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 03/14] media: mediatek: vcodec: add driver to support vcp encoder Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 04/14] media: mediatek: vcodec: get different firmware ipi id Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 05/14] media: mediatek: vcodec: get share memory address Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 06/14] media: mediatek: vcodec: add debug information Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 07/14] media: mediatek: vcodec: send share memory address to vcp Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 08/14] media: dt-bindings: mediatek,vcodec-subdev-decoder: Add MT8196 Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 09/14] media: mediatek: vcodec: add decoder compatible to support mt8196 Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 10/14] media: mediatek: vcodec: define MT8196 vcodec levels Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 11/14] media: mediatek: vcodec: support 36bit iova address Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 12/14] media: mediatek: vcodec: clean xpc status Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 13/14] media: mediatek: decoder: fill av1 buffer size with picinfo Kyrie Wu
2026-11-17  3:29 ` [PATCH v9 14/14] media: mediatek: decoder: support av1 extend vsi Kyrie Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261117032950.1425556-1-kyrie.wu@mediatek.com \
    --to=kyrie.wu@mediatek.com \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fanwu01@zju.edu.cn \
    --cc=fshao@chromium.org \
    --cc=haoxiang_li2024@163.com \
    --cc=hverkuil+cisco@kernel.org \
    --cc=irui.wang@mediatek.com \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=kees@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=ribalda@chromium.org \
    --cc=robh@kernel.org \
    --cc=rongqianfeng@vivo.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.org \
    --cc=tiffany.lin@mediatek.com \
    --cc=wenst@chromium.org \
    --cc=yunfei.dong@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®