aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/2018_03_final-days-for-the-upstream-linux-allwinner-vpu-support-crowdfunding-campaign.md
blob: da4f2aa0edf32744cce34fd08a4f706cc67b7b1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
date: 2018-03-07T21:24:03+00:00
title: Final days for the upstream Linux Allwinner VPU support crowdfunding campaign
authors: Paul Kocialkowski
tags: Replicant news, Paul Kocialkowski
---
A [crowdfunding campaign][1] was launched over a month ago by [Bootlin][2] in
order to fund the development of an [upstream Linux kernel driver for the
Allwinner CedarX VPU][3]. 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][4] bootloader and the [Linux
kernel][5].

Recently, Replicant was a candidate for the Google Summer of Code program and
we came up with a [list of tasks for the occasion][6]. 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][7], [U-Boot][8] and [Linux][9] 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][2] (formerly Free
Electrons) in Toulouse, France for an internship focused on supporting the
[Allwinner VPU][10] 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][1] in order to fund Maxime Ripard,
who has been working for the company and maintaining [Allwinner platforms in
the Linux kernel][11] 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][12] 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][13], that fits the
requirements for the Allwinner VPU driver. Other VPU drivers, such as the
[tegra-vde driver][14] that supports the Tegra 20 video decoder engine, also
require this API in order to implement a proper [V4L2 mem2mem driver][15].

The [crowdfunding campaign][1] 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.

 [1]: <https://bootlin.com/blog/allwinner-vpu-crowdfunding/>

 [2]: <https://bootlin.com/>

 [3]: <https://linux-sunxi.org/Cedrus>

 [4]: <https://www.denx.de/wiki/U-Boot>

 [5]: <https://www.kernel.org/>

 [6]:
<https://redmine.replicant.us/projects/replicant/wiki/Google_Summer_of_Code_2018>

 [7]: <https://review.coreboot.org/cgit/coreboot.git/>

 [8]: <http://git.denx.de/?p=u-boot.git;a=summary>

 [9]: <https://git.kernel.org/torvalds/>

 [10]: <https://linux-sunxi.org/Video_Engine>

 [11]: <https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git/>

 [12]:
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/sun4i>

 [13]: <https://www.spinics.net/lists/linux-media/msg129314.html>

 [14]:
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/media/tegra-vde>

 [15]:
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/media/v4l2-mem2mem.h>