Re: [PATCH v7 0/9] Add support for Wave6 video codec driver

From: Frank Li

Date: Thu Sep 10 2026 - 16:02:16 EST


On Fri, Sep 04, 2026 at 03:46:26PM +0900, Nas Chung wrote:
> This patch series introduces support for the Chips&Media Wave6 video
> codec IP, a completely different hardware architecture compared to Wave5.
>
> The wave6 driver is a M2M stateful encoder/decoder driver.
> It supports various video formats, including H.264 and H.265, for both encoding
> and decoding.
> While other versions of the Wave6 IP may support VP9 decoding and AV1 decoding
> and encoding those formats are not implemented or validated in this driver at
> this time.
>
> On NXP i.MX SoCs, the Wave6 hardware exposes one control register region and
> four interface register regions for one shared video processing engine.
> VPU Control region, Manages shared resources such as firmware memory.
> VPU Core region, Provides encoding and decoding capabilities.
> The control and interface regions are distinct DMA requesters and can be
> associated with separate IOMMU stream IDs, allowing DMA isolation between them.
>
> The interface regions are described as child nodes of the VPU node rather
> than folded into the parent with reg-names/interrupt-names, because each
> one is a separate DMA requester. This follows the same structure already
> accepted for the Qualcomm video codec bindings, and was mentioned on the v6
> thread.
>
> The firmware tested by this driver has been upstreamed in linux-firmware:
> - Path: cnm/wave633c_imx9_codec_fw.bin
>
> This driver has been tested with GStreamer on:
> - NXP i.MX95 board
> - pre-silicon FPGA environment
>
> Test results for decoder fluster with -j2 option:
> - JVT-AVC_V1, Ran 77/135 tests successfully in 24.180 secs
> - JVT-FR-EXT, Ran 25/69 tests successfully in 11.157 secs
> - JCT-VC-HEVC_V1, Ran 132/147 tests successfully in 45.534 secs
> - All failures are due to unsupported hardware features:
> -- 10bit, Resolutions higher than 4K, FMO, MBAFF
> -- Extended profile, Field encoding and High422 sreams.
>
> Test results for v4l2-compliance:
> v4l2-compliance 1.31.0-5386, 64 bits, 64-bit time_t
> v4l2-compliance SHA: 48316b8a20aa 2025-08-12 12:44:56
>
> Compliance test for wave6-dec device /dev/video0:
> fail: v4l2-test-controls.cpp(1204): !have_source_change || !have_eos
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> Total for wave6-dec device /dev/video0: 48, Succeeded: 47, Failed: 1, Warnings: 0
>
> Compliance test for wave6-enc device /dev/video1:
> fail: v4l2-test-controls.cpp(1193): node->codec_mask & STATEFUL_ENCODER
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL
> Total for wave6-enc device /dev/video1: 48, Succeeded: 47, Failed: 1, Warnings: 0
>
> Note: the failures are all related with the eos event.
>
> Changelog:
>
> v7:
> - Moved the sram property from imx95-19x19-evk.dts to imx95.dtsi
> - Simplified the sram binding property to maxItems: 1
> - Fixed the issues reported by the sashiko-bot review of v6:
> - Bounded frame buffer and aux buffer counts before indexing
> - Added vb2_is_busy() checks to the decoder S_FMT handlers
> - Fixed video_device lifetime and driver teardown ordering
> - Propagated hardware init, runtime PM and thermal failures upward
> - Fixed tracepoint field widths and debugfs handling
> - Balanced the VPU reference on the core activation error path
>
> v6:
> - Fixed the existing P010 format_info entry
> - Moved all encoder parameter validation from the HW layer into the V4L2 layer
> - Removed redundant HW-abstraction wrappers from the VPU API layer
> - Computed frame stride and sizeimage in the V4L2 layer
> - Added explicit instance lifecycle helpers to the core driver
> - Enabled the VPU only on the tested imx95-19x19-evk board
>
> RFC v5:
> - Move all shared resources to the parent node
> - Drop child compatible and use data-only interface child nodes
> - Update the VPU driver to create child devices and load the core driver
>
> v4:
> - Fixed build issues reported by CI tools
> - Updated commit messages to use imperative mood
> - Avoided using the same name for both nodes and labels in devicetree
> - Removed unused labels from YAML examples
> - Added description for child(vpu-core) node
> - Added iommus property to both parent(vpu) and child(vpu-core) nodes
> - Updated probe() functions to use dev_err_probe() when returning -EPROBE_DEFER
> - Added wave6_vpu prefix to trace functions
> - Updated HEVC decoder profile control to report MAIN_STILL profile
> - Fixed bug in multiple instance creation by pre-allocating work buffer
> - Fixed interrupt handling by checking INSTANCE_INFO register and instance list
>
> v3:
> - Removed ambiguous SUPPORT_FOLLOWER feature
> - Used WARN_ON() for unexpected programming errors
> - Split thermal device code into wave6-vpu-thermal.c/h
> - Dropped wave6_cooling_disable module parameter
> - Replaced mutex_lock() with guard()
> - Added lockdep_assert_held() to clarify locking regions
> - Removed exported function due to dual-license and used function pointer
> - Added documentation and validation for state transitions
> - Added documentation for device structures
> - Added patch to enable VPU device in imx95 DTS
> - Updated DT bindings and driver to align with parent(vpu) and child(vpu-core)
> - Replaced magic numbers with mask and offset macros when accessing registers
> - Placed goto statements after an empty line
> - Printed HW info (e.g. product_code) via dev_dbg() for debugging
> - Replaced wave6_vpu_dec_give_command() with dedicated functions
>
> v2:
> - Refined DT bindings to better represent the hardware
> - Reworked driver to align with the parent(VPU) and child(CTRL, CORE)
> - Fixed build issues reported by CI tools (Smatch, Sparse, TRACE)
> - Improved commit messages with clearer descriptions
> - Added kernel-doc for exported functions
> - Removed redundant print statements and unused code
> - Reordered patches to prevent build failures
>
> Nas Chung (9):
> media: v4l2-common: Fix P010 format info
> dt-bindings: media: nxp: Add Wave6 video codec device
> media: chips-media: wave6: Add Wave6 VPU interface
> media: chips-media: wave6: Add v4l2 m2m driver support
> media: chips-media: wave6: Add Wave6 core driver
> media: chips-media: wave6: Improve debugging capabilities
> media: chips-media: wave6: Add Wave6 thermal cooling device
> media: chips-media: wave6: Add Wave6 control driver

This is quite big drivers. You enable build at finial patches, it is not
good. Each patch expect built-able.

I suggest split

1. core part with simplest decode driver. "You use git add -p to choose
which trunk to add"
2. Add encode part
3. Add m2m part
4. add debug and tracing
5. add performance profile
6. add thermal cooling device

Maintainer may pick subset.

binding + simplest decode + dts can be merged firstly.

Then gradulately add encode, m2m and other advance features.

Frank

> arm64: dts: freescale: imx95: Add video codec node
>
> .../bindings/media/nxp,imx95-vpu.yaml | 162 +
> MAINTAINERS | 8 +
> .../boot/dts/freescale/imx95-19x19-evk.dts | 10 +
> arch/arm64/boot/dts/freescale/imx95.dtsi | 37 +
> drivers/media/platform/chips-media/Kconfig | 1 +
> drivers/media/platform/chips-media/Makefile | 1 +
> .../media/platform/chips-media/wave6/Kconfig | 17 +
> .../media/platform/chips-media/wave6/Makefile | 17 +
> .../platform/chips-media/wave6/wave6-hw.c | 2030 ++++++++++++
> .../platform/chips-media/wave6/wave6-hw.h | 56 +
> .../chips-media/wave6/wave6-regdefine.h | 649 ++++
> .../platform/chips-media/wave6/wave6-trace.h | 289 ++
> .../platform/chips-media/wave6/wave6-vdi.h | 92 +
> .../chips-media/wave6/wave6-vpu-core.c | 448 +++
> .../chips-media/wave6/wave6-vpu-core.h | 126 +
> .../chips-media/wave6/wave6-vpu-dbg.c | 183 ++
> .../chips-media/wave6/wave6-vpu-dbg.h | 14 +
> .../chips-media/wave6/wave6-vpu-dec.c | 1843 +++++++++++
> .../chips-media/wave6/wave6-vpu-enc.c | 2764 +++++++++++++++++
> .../chips-media/wave6/wave6-vpu-thermal.c | 143 +
> .../chips-media/wave6/wave6-vpu-thermal.h | 24 +
> .../chips-media/wave6/wave6-vpu-v4l2.c | 516 +++
> .../platform/chips-media/wave6/wave6-vpu.c | 826 +++++
> .../platform/chips-media/wave6/wave6-vpu.h | 143 +
> .../platform/chips-media/wave6/wave6-vpuapi.c | 336 ++
> .../platform/chips-media/wave6/wave6-vpuapi.h | 1007 ++++++
> .../chips-media/wave6/wave6-vpuconfig.h | 72 +
> .../chips-media/wave6/wave6-vpuerror.h | 262 ++
> drivers/media/v4l2-core/v4l2-common.c | 2 +-
> 29 files changed, 12077 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/devicetree/bindings/media/nxp,imx95-vpu.yaml
> create mode 100644 drivers/media/platform/chips-media/wave6/Kconfig
> create mode 100644 drivers/media/platform/chips-media/wave6/Makefile
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-hw.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-hw.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-regdefine.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-trace.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vdi.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-core.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-core.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-dbg.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-dbg.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-dec.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-enc.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-thermal.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-thermal.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu-v4l2.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpu.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpuapi.c
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpuapi.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpuconfig.h
> create mode 100644 drivers/media/platform/chips-media/wave6/wave6-vpuerror.h
>
> --
> 2.31.1
>