[PATCH 0/7] media: verisilicon: Add RK3588 VPU720 JPEG decoder

Sascha Hauer <[email protected]>
Newsgroups org.infradead.lists.linux-rockchip,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-media
Message-ID <[email protected]>
This series adds support for the RK3588 JPEG/MJPEG hardware decoder, the
VPU720. This series adds it to the hantro driver, along with three fixes
to the hantro core that came out of the work.

Patches 1-3 are independent of the new decoder and stand on their own. A
codec ->run() that fails currently leaves an armed watchdog behind that
later aborts an unrelated job, leaks the pm_runtime reference and the
clocks, and never completes the control handler object bound to the
media request, so the request stays queued until userspace closes it.
Patch 3 makes V4L2_EVENT_EOS subscribable; hantro queues the event in
three places but no application can ask for it.

Patches 4-7 add the decoder itself: the binding, the driver, a minimum
sizeimage for the coded queue, and the DT node.

Unlike the other hantro en/decoders the VPU720 works as a stateful
decoder - userspace hands it a whole frame and never looks inside the
bitstream. The driver parses the JPEG header on the CPU, builds the
quantisation and Huffman tables into a DMA side buffer and programs the
hardware from there.

Patch 6 enforces a minimum frame size to the coded queue for the JPEG
decoder path. This is necessary here as userspace doesn't know how large
a frame can get, but the decoder needs a full frame to work. In my
Gstreamer tests Gstreamer came up with buffers that were too small to
take a full frame at higher resolutions (> 1080p). That is expensive of
course, 16 MiB for a 4k image.

Tested on a Radxa Rock-5t board

Signed-off-by: Sascha Hauer <[email protected]>
---
Lucas Sinn (3):
      media: verisilicon: Add Rockchip VPU720 JPEG decoder
      media: verisilicon: Enforce a minimum sizeimage for the JPEG decoder
      arm64: dts: rockchip: rk3588: Add VPU720 JPEG decoder node

Sascha Hauer (4):
      media: verisilicon: Fix the cleanup when a codec ->run() fails
      media: verisilicon: Complete the request on the ->run() error paths
      media: verisilicon: Allow the EOS event to be subscribed
      media: dt-bindings: Add Rockchip RK3588 VPU720 JPEG decoder

 .../bindings/media/rockchip,rk3588-vpu720.yaml     |  93 ++
 MAINTAINERS                                        |   1 +
 arch/arm64/boot/dts/rockchip/rk3588-base.dtsi      |  25 +
 drivers/media/platform/verisilicon/Makefile        |   1 +
 drivers/media/platform/verisilicon/hantro.h        |  17 +
 drivers/media/platform/verisilicon/hantro_drv.c    |  49 +-
 .../platform/verisilicon/hantro_g1_h264_dec.c      |   6 +-
 .../platform/verisilicon/hantro_g1_mpeg2_dec.c     |   2 +-
 .../media/platform/verisilicon/hantro_g1_vp8_dec.c |   6 +-
 .../platform/verisilicon/hantro_g2_hevc_dec.c      |  11 +-
 .../media/platform/verisilicon/hantro_g2_vp9_dec.c |   4 +-
 .../platform/verisilicon/hantro_h1_jpeg_enc.c      |   2 +-
 drivers/media/platform/verisilicon/hantro_hw.h     |  19 +-
 drivers/media/platform/verisilicon/hantro_v4l2.c   |  69 +-
 .../verisilicon/rockchip_vpu2_hw_h264_dec.c        |   6 +-
 .../verisilicon/rockchip_vpu2_hw_jpeg_enc.c        |   6 +-
 .../verisilicon/rockchip_vpu2_hw_mpeg2_dec.c       |   2 +-
 .../verisilicon/rockchip_vpu2_hw_vp8_dec.c         |   6 +-
 .../verisilicon/rockchip_vpu720_hw_jpeg_dec.c      | 962 +++++++++++++++++++++
 .../platform/verisilicon/rockchip_vpu720_regs.h    | 261 ++++++
 .../verisilicon/rockchip_vpu981_hw_av1_dec.c       |   5 +-
 .../media/platform/verisilicon/rockchip_vpu_hw.c   |  80 ++
 22 files changed, 1595 insertions(+), 38 deletions(-)
---
base-commit: bd5f485f3f026225b86573e559af0b7254ef4184
change-id: 20260819-rk3588-jpegdec-89e1cf4c8898

Best regards,
-- 
Sascha Hauer <[email protected]>


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.