Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/7] media: verisilicon: Add RK3588 VPU720 JPEG decoder
@ 2026-08-19 10:37 Sascha Hauer
  2026-08-19 10:37 ` [PATCH 1/7] media: verisilicon: Fix the cleanup when a codec ->run() fails Sascha Hauer
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Sascha Hauer @ 2026-08-19 10:37 UTC (permalink / raw)
  To: Nicolas Dufresne, Benjamin Gaignard, Philipp Zabel,
	Mauro Carvalho Chehab, Heiko Stuebner, Ezequiel Garcia,
	Andrzej Pietrasiewicz, Hans Verkuil, Chen-Yu Tsai, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Lucas Sinn
  Cc: Mauro Carvalho Chehab, linux-media, linux-rockchip, linux-kernel,
	linux-arm-kernel, devicetree, Sascha Hauer

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 <s.hauer@pengutronix.de>
---
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 <s.hauer@pengutronix.de>


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-08-19 15:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 10:37 [PATCH 0/7] media: verisilicon: Add RK3588 VPU720 JPEG decoder Sascha Hauer
2026-08-19 10:37 ` [PATCH 1/7] media: verisilicon: Fix the cleanup when a codec ->run() fails Sascha Hauer
2026-08-19 11:23   ` sashiko-bot
2026-08-19 15:05   ` Nicolas Dufresne
2026-08-19 10:37 ` [PATCH 2/7] media: verisilicon: Complete the request on the ->run() error paths Sascha Hauer
2026-08-19 12:19   ` sashiko-bot
2026-08-19 10:37 ` [PATCH 3/7] media: verisilicon: Allow the EOS event to be subscribed Sascha Hauer
2026-08-19 10:37 ` [PATCH 4/7] media: dt-bindings: Add Rockchip RK3588 VPU720 JPEG decoder Sascha Hauer
2026-08-19 10:37 ` [PATCH 5/7] media: verisilicon: Add Rockchip " Sascha Hauer
2026-08-19 11:24   ` sashiko-bot
2026-08-19 12:46   ` Heiko Stübner
2026-08-19 14:12     ` Sascha Hauer
2026-08-19 15:48   ` Nicolas Dufresne
2026-08-19 10:37 ` [PATCH 6/7] media: verisilicon: Enforce a minimum sizeimage for the " Sascha Hauer
2026-08-19 10:37 ` [PATCH 7/7] arm64: dts: rockchip: rk3588: Add VPU720 JPEG decoder node Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox