public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/4] media: cedrus: Add a JPEG decoder
@ 2024-07-31 16:44 Emmanuel Gil Peyrot
  2024-07-31 16:44 ` [PATCH 1/4] media: cedrus: Setup secondary output formats Emmanuel Gil Peyrot
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Emmanuel Gil Peyrot @ 2024-07-31 16:44 UTC (permalink / raw)
  To: linux-sunxi
  Cc: Emmanuel Gil Peyrot, Maxime Ripard, Paul Kocialkowski,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, linux-kernel, linux-media,
	linux-staging, linux-arm-kernel

The Video Engine present on all (?) AllWinner SoCs includes a JPEG
decoder, which shares the same engine as the MPEG2 decoder.  I mostly
used the linux-sunxi resources on the engine[0], as well as some
reverse-engineered userland using the legacy /dev/cedar_dev API[1].

I wrote the Onix library[2] to exercise this driver.  With it, I have
tested this series on the A10, A20 and A64, as found in Olimex Lime,
Lime 2 and PinePhone respectively, so further testing on other SoCs
would be very welcome.

On the A10 and A20, since only the tiled ST12 format is supported, the
file dump binary is a bit unusable, but I have tested displaying to DRM
and to Wayland just fine on these SoCs.

They also only support downscaling from 4:4:4 to 4:2:2, unlike newer
SoCs which support downscaling from either 4:4:4 or 4:2:2 to 4:2:2 or
4:2:0.  This prompts the issue of which formats to advertise: currently
I chose to only expose NV12, but ideally NV16 would be exposed when the
user tries to decode a 4:2:2 or 4:4:4 image.  By the time the user has
called ENUM_FMTS on the capture queue, the driver doesn’t know the
subsampling in the JPEG file, so it can’t expose only the supported
formats.  A possible solution could be to add a new v4l2_ext_ctrl
describing the JPEG, but this is a new uAPI which should get discussed
outside of this driver.

[0] https://linux-sunxi.org/VE_Register_guide
[1] https://github.com/jemk/cedrus
[2] https://linkmauve.fr/dev/onix/

Emmanuel Gil Peyrot (1):
  media: cedrus: Add JPEG decoder

Jernej Skrabec (3):
  media: cedrus: Setup secondary output formats
  media: cedrus: Enable JPEG decoding in various variants
  media: cedrus: Don't require requests for all codecs

 drivers/staging/media/sunxi/cedrus/Kconfig    |   1 +
 drivers/staging/media/sunxi/cedrus/Makefile   |   2 +-
 drivers/staging/media/sunxi/cedrus/cedrus.c   |  10 +
 drivers/staging/media/sunxi/cedrus/cedrus.h   |   5 +
 .../staging/media/sunxi/cedrus/cedrus_hw.c    |  14 +-
 .../staging/media/sunxi/cedrus/cedrus_jpeg.c  | 352 ++++++++++++++++++
 .../staging/media/sunxi/cedrus/cedrus_regs.h  |  25 +-
 .../staging/media/sunxi/cedrus/cedrus_video.c |  11 +-
 8 files changed, 413 insertions(+), 7 deletions(-)
 create mode 100644 drivers/staging/media/sunxi/cedrus/cedrus_jpeg.c

-- 
2.45.2



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

end of thread, other threads:[~2025-02-20 17:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 16:44 [PATCH 0/4] media: cedrus: Add a JPEG decoder Emmanuel Gil Peyrot
2024-07-31 16:44 ` [PATCH 1/4] media: cedrus: Setup secondary output formats Emmanuel Gil Peyrot
2024-07-31 16:44 ` [PATCH 2/4] media: cedrus: Add JPEG decoder Emmanuel Gil Peyrot
2025-02-13 17:12   ` Sebastian Fricke
2025-02-20 17:32     ` Jernej Škrabec
2024-07-31 16:44 ` [PATCH 3/4] media: cedrus: Enable JPEG decoding in various variants Emmanuel Gil Peyrot
2024-07-31 16:44 ` [PATCH 4/4] media: cedrus: Don't require requests for all codecs Emmanuel Gil Peyrot
2024-07-31 16:56   ` Dan Carpenter
2025-02-20 17:34     ` Jernej Škrabec

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