Skip to content

Commit 50e7615

Browse files
paulkocialkowskimchehab
authored andcommitted
media: platform: Add Cedrus VPU decoder driver
This introduces the Cedrus VPU driver that supports the VPU found in Allwinner SoCs, also known as Video Engine. It is implemented through a V4L2 M2M decoder device and a media device (used for media requests). So far, it only supports MPEG-2 decoding. Since this VPU is stateless, synchronization with media requests is required in order to ensure consistency between frame headers that contain metadata about the frame to process and the raw slice data that is used to generate the frame. This driver was made possible thanks to the long-standing effort carried out by the linux-sunxi community in the interest of reverse engineering, documenting and implementing support for the Allwinner VPU. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: dropped obsolete MEDIA_REQUEST_API from Kconfig] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
1 parent a20625f commit 50e7615

File tree

18 files changed

+2155
-0
lines changed

18 files changed

+2155
-0
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,13 @@ L: linux-crypto@vger.kernel.org
663663
S: Maintained
664664
F: drivers/crypto/sunxi-ss/
665665

666+
ALLWINNER VPU DRIVER
667+
M: Maxime Ripard <maxime.ripard@bootlin.com>
668+
M: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
669+
L: linux-media@vger.kernel.org
670+
S: Maintained
671+
F: drivers/staging/media/sunxi/cedrus/
672+
666673
ALPHA PORT
667674
M: Richard Henderson <rth@twiddle.net>
668675
M: Ivan Kokshaysky <ink@jurassic.park.msu.ru>

drivers/staging/media/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ source "drivers/staging/media/mt9t031/Kconfig"
3131

3232
source "drivers/staging/media/omap4iss/Kconfig"
3333

34+
source "drivers/staging/media/sunxi/Kconfig"
35+
3436
source "drivers/staging/media/tegra-vde/Kconfig"
3537

3638
source "drivers/staging/media/zoran/Kconfig"

drivers/staging/media/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ obj-$(CONFIG_SOC_CAMERA_IMX074) += imx074/
55
obj-$(CONFIG_SOC_CAMERA_MT9T031) += mt9t031/
66
obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/
77
obj-$(CONFIG_VIDEO_OMAP4) += omap4iss/
8+
obj-$(CONFIG_VIDEO_SUNXI) += sunxi/
89
obj-$(CONFIG_TEGRA_VDE) += tegra-vde/
910
obj-$(CONFIG_VIDEO_ZORAN) += zoran/

drivers/staging/media/sunxi/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
config VIDEO_SUNXI
2+
bool "Allwinner sunXi family Video Devices"
3+
depends on ARCH_SUNXI || COMPILE_TEST
4+
help
5+
If you have an Allwinner SoC based on the sunXi family, say Y.
6+
7+
Note that this option doesn't include new drivers in the
8+
kernel: saying N will just cause Kconfig to skip all the
9+
questions about Allwinner media devices.
10+
11+
if VIDEO_SUNXI
12+
13+
source "drivers/staging/media/sunxi/cedrus/Kconfig"
14+
15+
endif

drivers/staging/media/sunxi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-$(CONFIG_VIDEO_SUNXI_CEDRUS) += cedrus/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
config VIDEO_SUNXI_CEDRUS
2+
tristate "Allwinner Cedrus VPU driver"
3+
depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
4+
depends on HAS_DMA
5+
depends on OF
6+
select SUNXI_SRAM
7+
select VIDEOBUF2_DMA_CONTIG
8+
select V4L2_MEM2MEM_DEV
9+
help
10+
Support for the VPU found in Allwinner SoCs, also known as the Cedar
11+
video engine.
12+
13+
To compile this driver as a module, choose M here: the module
14+
will be called sunxi-cedrus.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
obj-$(CONFIG_VIDEO_SUNXI_CEDRUS) += sunxi-cedrus.o
2+
3+
sunxi-cedrus-y = cedrus.o cedrus_video.o cedrus_hw.o cedrus_dec.o cedrus_mpeg2.o
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Before this stateless decoder driver can leave the staging area:
2+
* The Request API needs to be stabilized;
3+
* The codec-specific controls need to be thoroughly reviewed to ensure they
4+
cover all intended uses cases;
5+
* Userspace support for the Request API needs to be reviewed;
6+
* Another stateless decoder driver should be submitted;
7+
* At least one stateless encoder driver should be submitted.

0 commit comments

Comments
 (0)