Final days for the upstream Linux Allwinner VPU support crowdfunding campaign

A crowdfunding campaign was launched over a month ago by Bootlin in order to fund the development of an upstream Linux kernel driver for the Allwinner CedarX VPU. The VPU (Video Processing Unit) is in charge of offloading video decoding and encoding to a dedicated hardware block, relieving the main CPU. While Replicant does not support Allwinner devices at this point, the project has acquired a number of Allwinner tablets a few years ago, that helped with the advancements of Allwinner platforms support in upstream projects such as the U-Boot bootloader and the Linux kernel.

Recently, Replicant was a candidate for the Google Summer of Code program and we came up with a list of tasks for the occasion. Although our application was not accepted, we are still interested in completing the tasks that we picked up. We put a deliberate focus on supporting mobile devices in mainline U-Boot and Linux, with a particular emphasis on Allwinner devices, the Optimus Black and the Kindle Fire (first generation). We believe that supporting mobile devices and using standard driver interfaces in the upstream Linux kernel is the only sustainable way for freedom on mobile devices. Instead of writing device-specific code specifically for Android for each of the supported devices, this would allow using generic Hardware Abstraction layers (HALs), reducing the amount of work for hardware support on the Replicant side in the long run. This also allows running other operating systems that integrate the upstream Linux kernel interfaces, such as standard GNU/Linux distributions.

In spite of this, I have been dedicating more and more time to contributing to upstream projects such as coreboot, U-Boot and Linux for supporting devices of various form factors, including mobile devices, laptops and single-board computers. Thus, I became less and less active on the technical side for Replicant, where Wolfgang and others have picked-up the work. There is still a lot of room for contributions and everyone is warmly encouraged to join-in and help with the upstreaming effort for devices, especially regarding the Optimus Black, Kindle Fire (first generation) and Allwinner devices.

As a student approaching graduation, I have joined Bootlin (formerly Free Electrons) in Toulouse, France for an internship focused on supporting the Allwinner VPU in upstream Linux and userspace. It definitely fits perfectly with the logic behind focusing Replicant towards upstream Linux support. In order to accelerate the development of the driver, Bootlin has decided to start a crowdfunding campaign in order to fund Maxime Ripard, who has been working for the company and maintaining Allwinner platforms in the Linux kernel for a while.

As the main goal of the campaign was reached within its first week, Maxime will be able to work with me on the VPU. His in-depth understanding of the sun4i DRM video driver’s innards will also reveal very useful for accelerating the processing of the frames coming from the VPU (without unneeded copies of buffers) and implementing scaling in hardware. In order to support the VPU hardware efficiently, a number of changes have to be introduced to the Linux kernel. It currently lacks an interface to provide coherency between setting specific controls for the media stream and the input/output buffers that these controls are related to and should apply to. This API has been implemented by Alexandre Courbot (who’s working at Google on the Chromium OS project) as the V4L2 request API, that fits the requirements for the Allwinner VPU driver. Other VPU drivers, such as the tegra-vde driver that supports the Tegra 20 video decoder engine, also require this API in order to implement a proper V4L2 mem2mem driver.

The crowdfunding campaign still has 10 days to go and two stretch goals to meet (while the first stretch goal, about supporting newer Allwinner SoCs was already met):

  • H265 video decoding support
  • H264 encoding support

As I am not directly impacted by the funding received through the crowdfunding campaign, we believe that there is no direct conflict of interest writing this blog post on the Replicant blog.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.