Skip to content

Commit

Permalink
media: platform: Add Cedrus VPU decoder driver
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
[[email protected]: dropped obsolete MEDIA_REQUEST_API from Kconfig]
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
paulkocialkowski authored and mchehab committed Sep 24, 2018
1 parent a20625f commit 50e7615
Show file tree
Hide file tree
Showing 18 changed files with 2,155 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,13 @@ L: [email protected]
S: Maintained
F: drivers/crypto/sunxi-ss/

ALLWINNER VPU DRIVER
M: Maxime Ripard <[email protected]>
M: Paul Kocialkowski <[email protected]>
L: [email protected]
S: Maintained
F: drivers/staging/media/sunxi/cedrus/

ALPHA PORT
M: Richard Henderson <[email protected]>
M: Ivan Kokshaysky <[email protected]>
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/media/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ source "drivers/staging/media/mt9t031/Kconfig"

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

source "drivers/staging/media/sunxi/Kconfig"

source "drivers/staging/media/tegra-vde/Kconfig"

source "drivers/staging/media/zoran/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/media/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ obj-$(CONFIG_SOC_CAMERA_IMX074) += imx074/
obj-$(CONFIG_SOC_CAMERA_MT9T031) += mt9t031/
obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/
obj-$(CONFIG_VIDEO_OMAP4) += omap4iss/
obj-$(CONFIG_VIDEO_SUNXI) += sunxi/
obj-$(CONFIG_TEGRA_VDE) += tegra-vde/
obj-$(CONFIG_VIDEO_ZORAN) += zoran/
15 changes: 15 additions & 0 deletions drivers/staging/media/sunxi/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
config VIDEO_SUNXI
bool "Allwinner sunXi family Video Devices"
depends on ARCH_SUNXI || COMPILE_TEST
help
If you have an Allwinner SoC based on the sunXi family, say Y.

Note that this option doesn't include new drivers in the
kernel: saying N will just cause Kconfig to skip all the
questions about Allwinner media devices.

if VIDEO_SUNXI

source "drivers/staging/media/sunxi/cedrus/Kconfig"

endif
1 change: 1 addition & 0 deletions drivers/staging/media/sunxi/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-$(CONFIG_VIDEO_SUNXI_CEDRUS) += cedrus/
14 changes: 14 additions & 0 deletions drivers/staging/media/sunxi/cedrus/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config VIDEO_SUNXI_CEDRUS
tristate "Allwinner Cedrus VPU driver"
depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
depends on HAS_DMA
depends on OF
select SUNXI_SRAM
select VIDEOBUF2_DMA_CONTIG
select V4L2_MEM2MEM_DEV
help
Support for the VPU found in Allwinner SoCs, also known as the Cedar
video engine.

To compile this driver as a module, choose M here: the module
will be called sunxi-cedrus.
3 changes: 3 additions & 0 deletions drivers/staging/media/sunxi/cedrus/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
obj-$(CONFIG_VIDEO_SUNXI_CEDRUS) += sunxi-cedrus.o

sunxi-cedrus-y = cedrus.o cedrus_video.o cedrus_hw.o cedrus_dec.o cedrus_mpeg2.o
7 changes: 7 additions & 0 deletions drivers/staging/media/sunxi/cedrus/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Before this stateless decoder driver can leave the staging area:
* The Request API needs to be stabilized;
* The codec-specific controls need to be thoroughly reviewed to ensure they
cover all intended uses cases;
* Userspace support for the Request API needs to be reviewed;
* Another stateless decoder driver should be submitted;
* At least one stateless encoder driver should be submitted.
Loading

0 comments on commit 50e7615

Please sign in to comment.