Re: [PATCH v7 2/4] media: rockchip: Add JPEG decoder driver

From: Sascha Hauer

Date: Fri Nov 20 2026 - 08:49:30 EST


Hi Nicolas,

On 2026-11-19 11:00, Nicolas Dufresne wrote:
> Le mercredi 18 novembre 2026 à 14:27 +0000, Sascha Hauer a écrit :
> > > Would 3 bytes per pixel be acceptable as the default, and as a floor
> > > for smaller requests, like the 2 bytes per pixel floor in 6/7 of your
> > > hantro-based v1? 4:4:4 at quality 100 would still not fit, but the
> > > subsampling is not known before the header is parsed.
> >
> > I haven't been affected by this issue lately, but saw it when the series
> > was still based on the hantro driver. Yes, I'll change to 3 bytes per
> > pixel next round and make that the floor of sizeimage. Would be nice to
> > have a proper solution for this rather than either wasting tons of
> > memory or risk having too small buffers.
>
> The hantro HW can run in ring buffer mode, that forces us to copy, but I think
> you can then perform decode without actually having the entire image in RAM.
> Would need some experimentation. We probably don't want copy to mmap + copy to
> ring buffer (double copy), and V4L2 read/write are deprecated. Note sure what to
> propose really.

The Rockchip JPEG decoder can stop on buffer ends and I just managed to
resume operation on the next buffer afterwards, so in principle we could
implement streaming mode.

Anyway, I'd say it's not worth adding the complexity to the driver to
handle that.

Sascha

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |