Re: [PATCH v3 0/6] media: iris: prepare support for video codecs on Qcom vpu4 platform

From: Dmitry Baryshkov

Date: Tue Nov 11 2025 - 05:44:39 EST


On Fri, Nov 07, 2025 at 03:19:35PM +0530, Vikash Garodia wrote:
> Upcoming Qualcomm kaanapali platform have a newer generation of video
> IP, iris4 or vpu4. The hardware have evolved mostly w.r.t higher number
> of power domains as well as multiple clock sources. It has support for
> new codec(apv), when compared to prior generation.
>
> From previous version of this series, the kaanapali binding patch(#1/8)
> and the compatible patch(#8/8) have been dropped. The discussion for
> this is captured here [1].
> The series introducs buffer calculation and power sequence for vpu4. It
> prepares for vpu4 when kaanapali is enabled after the binding discussion
> is concluded.
>
>
> gstreamer test:
> Decoders validated with below commands, codec specific:

Why not just run the fluster testsuite?

> gst-launch-1.0 multifilesrc location=<input_file.h264> stop-index=0 !
> parsebin ! v4l2h264dec ! video/x-raw ! videoconvert dither=none !
> video/x-raw,format=I420 ! filesink location=<output_file.yuv>
>
> gst-launch-1.0 multifilesrc location=<input_file.hevc> stop-index=0 !
> parsebin ! v4l2h265dec ! video/x-raw ! videoconvert dither=none !
> video/x-raw,format=I420 ! filesink location=<output_file.yuv>
>
> gst-launch-1.0 filesrc location=<input_file.webm> stop-index=0 !
> parsebin ! vp9dec ! video/x-raw ! videoconvert dither=none !
> video/x-raw,format=I420 ! filesink location=<output_file.yuv>
>
> Encoders validated with below commands:
> gst-launch-1.0 -v filesrc location=<input_file.yuv> ! rawvideoparse
> format=nv12 width=<width> height=<height> framerate=30/1 ! v4l2h264enc
> capture-io-mode=4 output-io-mode=4 ! filesink sync=true
> location=<output_file.h264>
>
> gst-launch-1.0 -v filesrc location=<input_file.yuv> ! rawvideoparse
> format=nv12 width=<width> height=<height> framerate=30/1 ! v4l2h265enc
> capture-io-mode=4 output-io-mode=4 ! filesink sync=true
> location=<output_file.hevc>
>
> ffmpeg test:
> Decoders validated with below commands:
> ffmpeg -vcodec h264_v4l2m2m -i <input_file.h264> -pix_fmt nv12 -vsync 0
> output_file.yuv -y
> ffmpeg -vcodec hevc_v4l2m2m -i <input_file.hevc> -pix_fmt nv12 -vsync 0
> output_file.yuv -y
> ffmpeg -vcodec vp9_v4l2m2m -i <input_file.webm> -pix_fmt nv12 -vsync 0
> output_file.yuv -y
>
> v4l2-ctl test
> Decoders validated with below commands:
> v4l2-ctl --verbose --set-fmt-video-out=pixelformat=H264
> --set-fmt-video=pixelformat=NV12 --stream-mmap --stream-out-mmap
> --stream-from=<input_file.h264> --stream-to=<output_file.yuv>
>
> v4l2-ctl --verbose --set-fmt-video-out=pixelformat=HEVC
> --set-fmt-video=pixelformat=NV12 --stream-mmap --stream-out-mmap
> --stream-from=input_file.bit --stream-to=<output_file.yuv>
>
> v4l2-ctl --verbose --set-fmt-video-out=pixelformat=VP90
> --set-fmt-video=pixelformat=NV12 --stream-mmap --stream-out-mmap
> --stream-from-hdr=input_file.hdr --stream-mmap
> --stream-to=<output_file.yuv>
>
> Encoders validated with below commands:
> v4l2-ctl --verbose
> --set-fmt-video-out=width=<width>,height=<height>,pixelformat=NV12
> --set-selection-output
> target=crop,top=0,left=0,width=<width>,height=<height>
> --set-fmt-video=pixelformat=H264 --stream-mmap --stream-out-mmap
> --stream-from=<input_file.yuv> --stream-to=<output_file.h264> -d
> /dev/video1
> v4l2-ctl --verbose
> --set-fmt-video-out=width=<width>,height=<height>,pixelformat=NV12
> --set-selection-output
> target=crop,top=0,left=0,width=<width>,height=<height>
> --set-fmt-video=pixelformat=HEVC --stream-mmap --stream-out-mmap
> --stream-from=<input_file.yuv> --stream-to=<output_file.hevc> -d
> /dev/video1
>
> Note: there is a crash observed while performing below sequence
> rmmod qcom-iris
> modprobe qcom-iris
> The crash is not seen if ".skip_retention_level = true" is added to
> mmcx and mmcx_ao power domains in rpmhpd.c. This is under debug with
> rpmh module owner to conclude if it to be fixed differently.
>
> Signed-off-by: Vikash Garodia <vikash.garodia@xxxxxxxxxxxxxxxx>
> ---
> Changes in v3:
> - Drop the binding and compat patch.
> - Address comments related to variable handlings (Bryan)
> - Pick the updates from Dmitry related to sort register #defines and
> connecting register and their corresponding bits operation (Dmitry)
> - Link to v2: https://lore.kernel.org/r/20251017-knp_video-v2-0-f568ce1a4be3@xxxxxxxxxxxxxxxx
>
> Changes in v2:
> - Dropped dependencies from binding (Dmitry).
> - Dropped optional items from binding (Dmitry, Krzysztof, Konrad).
> - Updated binding in sorted order and proper alignment (Krzysztof).
> - Fixed order of newly introduced kaanapali struct (Dmitry, Bryan)
> - Improved readability of buffer size calculation (Bryan)
> - Optimized fuse register read (Konrad).
> - Fixed order of vpu register defines (Dmitry).
> - Addressed few other log and commit related comments (Bryan)
> - Link to v1: https://lore.kernel.org/r/20250925-knp_video-v1-0-e323c0b3c0cd@xxxxxxxxxxxxxxxx
>
> ---
> Vikash Garodia (6):
> media: iris: Add support for multiple clock sources
> media: iris: Add support for multiple TZ content protection(CP) configs
> media: iris: Introduce buffer size calculations for vpu4
> media: iris: Move vpu register defines to common header file
> media: iris: Move vpu35 specific api to common to use for vpu4
> media: iris: Introduce vpu ops for vpu4 with necessary hooks
>
> drivers/media/platform/qcom/iris/Makefile | 1 +
> drivers/media/platform/qcom/iris/iris_firmware.c | 23 +-
> .../platform/qcom/iris/iris_platform_common.h | 11 +-
> .../media/platform/qcom/iris/iris_platform_gen2.c | 33 +-
> .../platform/qcom/iris/iris_platform_sm8250.c | 21 +-
> drivers/media/platform/qcom/iris/iris_power.c | 2 +-
> drivers/media/platform/qcom/iris/iris_probe.c | 20 +-
> drivers/media/platform/qcom/iris/iris_resources.c | 16 +-
> drivers/media/platform/qcom/iris/iris_resources.h | 1 +
> drivers/media/platform/qcom/iris/iris_vpu3x.c | 199 +-----------
> drivers/media/platform/qcom/iris/iris_vpu4x.c | 358 +++++++++++++++++++++
> drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 342 ++++++++++++++++++++
> drivers/media/platform/qcom/iris/iris_vpu_buffer.h | 24 ++
> drivers/media/platform/qcom/iris/iris_vpu_common.c | 188 ++++++++---
> drivers/media/platform/qcom/iris/iris_vpu_common.h | 5 +
> .../platform/qcom/iris/iris_vpu_register_defines.h | 61 ++++
> 16 files changed, 1026 insertions(+), 279 deletions(-)
> ---
> base-commit: f215d17ddbe8502804ae65d8f855100daf347061
> change-id: 20250924-knp_video-aaf4c40be747
>
> Best regards,
> --
> Vikash Garodia <vikash.garodia@xxxxxxxxxxxxxxxx>
>

--
With best wishes
Dmitry