GraphicsResearch » History » Version 24

dl lud, 01/23/2019 04:41 AM
Per-GPU subtitles: replaced "and" by "with" to make a clear distinction between GPU name and driver name.

1 1 Wolfgang Wiedmeyer
h1. Research on free graphics-related software
3 12 Wolfgang Wiedmeyer
5 5 Wolfgang Wiedmeyer
On this page, information is collected that could help solving graphics issues in Replicant (see #1539). Besides evaluating free implementations that are relevant for currently supported devices, other implementations should also be listed if they are useful for potential future target devices.
6 1 Wolfgang Wiedmeyer
7 8 Wolfgang Wiedmeyer
external resources:
9 13 Wolfgang Wiedmeyer
"Debian Mobile":
10 8 Wolfgang Wiedmeyer
11 21 Denis 'GNUtoo' Carikli
h2. Multiple backends
See for work in progress to enable to switch the OpenGL library for individual applications.
15 1 Wolfgang Wiedmeyer
h2. Software rendering
17 7 Wolfgang Wiedmeyer
Software rendering uses the CPU and not a dedicated graphics processor for graphics rendering. It is slower than per-GPU implementations and is usually used when it is not possible to make use of the GPU. An advantage is that the same software renderer can work across many different types of hardware, so working on improving a software renderer benefits many different devices, regardless of the SOC and graphics unit that is used. Furthermore, a software renderer doesn't require a kernel driver which makes it easier to work on mainline Linux kernel support for a device until the graphics driver is in mainline.
18 2 Wolfgang Wiedmeyer
19 1 Wolfgang Wiedmeyer
h3. Android software renderer
20 2 Wolfgang Wiedmeyer
21 14 Wolfgang Wiedmeyer
source code:
22 2 Wolfgang Wiedmeyer
The Android software renderer is currently used on all Replicant-supported devices and it is the fastest software renderer that is available for Replicant devices. It is a software renderer that was developed specifically for Android and it is part of the AOSP source code. The renderer includes optimizations for ARM. Development ceased in 2013 and no work was done to support newer GLES versions (which causes #705).
Until ca. 2011 (Android 4.0), another library with the name @libagl2@ existed and @surfaceflinger2@ was developed based on Mesa. The source code was later removed and no further development is known. At the time, the work was done to support a newer GLES version for the software renderer, but it was abandoned later. It is questionable if it is worth it to port the old @libagl2@ library to a recent Replicant version, also given that we would be the only ones using and maintaining the code.
26 1 Wolfgang Wiedmeyer
27 19 Denis 'GNUtoo' Carikli
h3. Mesa and llvmpipe
28 1 Wolfgang Wiedmeyer
29 20 Denis 'GNUtoo' Carikli
*Replicant llvmpipe support source code*:
*Replicant documentation*: [[Graphics]]
*Upstream documentation*:
*Upstream performance improvement documentation*:
33 3 Wolfgang Wiedmeyer
34 4 Wolfgang Wiedmeyer
For the needs in Replicant, llvmpipe has an EGL implementation that is complete enough. But some apps don't work due to minor bugs which seem fixable or which might already be fixed in more recent upstream versions. swrast is of no interest as it is slower than llvmpipe.
35 3 Wolfgang Wiedmeyer
The "Android-x86  project": is using llvmpipe and quite a few of their Android-specific frameworks patches are applied in Replicant 6.0. Their Mesa source code fork is also used in Replicant 6.0. A lot of porting work of llvmpipe to Android was done by Jide while Intel is contributing as well. So there is an interest from different parties to have llvmpipe working on Android. Android patches are upstreamed to mainline Mesa.
However, llvmpipe is still not ported to ARM which makes it slow. Also for Android, it is mostly used on the x86 platform in other projects. See #705 for more information. Optimizing llvmpipe for ARM seems currently the most promising approach to fix graphics-related issues with Replicant.
40 1 Wolfgang Wiedmeyer
h3. SwiftShader
41 3 Wolfgang Wiedmeyer
source code:
44 18 Joonas Kylmälä
"Google released SwiftShader as free software in mid 2016": It supports x86 (32 bit and 64 bit) and 32 bit ARM architectures with SDIV/UDIV support. It is used in the Chromium project but also with Android, for example in the Android-x86 project. Swiftshader doesn't seem to depend on any external libraries besides what are provided in its Git repository, therefore it is very easy to compile it and use it as a software renderer for Replicant. All the Android  build files are provided so you just need to the add the following packages to PRODUCT_PACKAGES in order to be able to use it:
 * libGLESv2_swiftshader
 * libEGL_swiftshader
48 1 Wolfgang Wiedmeyer
h2. Per-GPU implementations
51 9 Wolfgang Wiedmeyer
In the following, free software implementations are listed that should make it possible to use the respective GPU with free software.
52 1 Wolfgang Wiedmeyer
53 23 dl lud
h3. ARM Mali-4xx (Utgard) with Lima
54 7 Wolfgang Wiedmeyer
55 22 dl lud
Supported devices that use Mali 400: Galaxy S 2, Galaxy S 3, Galaxy S 3 4G, Galaxy Note, Galaxy Note 2
56 7 Wolfgang Wiedmeyer
57 22 dl lud
Project page:
58 1 Wolfgang Wiedmeyer
59 22 dl lud
Lima is still unfinished as of January 2019 but development is going on at a fast pace. The detailed implementation status can be checked "with the piglit test suite":
60 7 Wolfgang Wiedmeyer
61 23 dl lud
Lima saw first light with the reverse-engineering efforts by Luc Verhaegen, that produced an experimental driver with it's original page at  
62 22 dl lud . Luc's development stopped around 2014, but in 2017 Qiang Yu took on the task and started development on top of Mesa's Gallium3D driver as "reported by Phoronix": 
The code is now hosted at "'s GitLab": and is getting contributions by many developers besides Qiang Yu.
64 16 Jeremy Rand
65 1 Wolfgang Wiedmeyer
h3. Imagination PowerVR
supported devices that use PowerVR SGX540: Nexus S, Galaxy S, Galaxy Nexus, Galaxy Tab 2 7.0, Galaxy Tab 2 10.1
68 5 Wolfgang Wiedmeyer
supported devices that use PowerVR SGX530: GTA04
69 8 Wolfgang Wiedmeyer
A reverse-engineering project exists:
71 10 Wolfgang Wiedmeyer
"mailing list":
73 8 Wolfgang Wiedmeyer
"Libreplanet group":
74 1 Wolfgang Wiedmeyer
Despite initial reverse-engineering progress until 2013, no further development updates seem to be available. The project website provides documentation.
76 23 dl lud
h3. ARM Mali-T6xx/T7xx/T8xx (Midgard) and G7x (Bifrost) with Panfrost
not used by a supported device
Used on several Samsung Galaxy S series phones that are now supported by LineageOs and may be potential targets for Replicant ports: S6
(Mali T760MP8), S7 (Mali-T880 MP12) and S9 (Mali-G72 MP18).
Project page:
Source code:
Panfrost is another reverse-engineered driver for ARM Mali GPUs, but aimed at the latest architectures (Midgard and Bifrost). It is still experimental but under active development with a strong community (as of January 2019). It's main focus are the ARM SoCs present on some laptops and single-board computers (SBC), but it is "Intended to work on as many SoCs as possible to make everyone's lives easier":
Panfrost is developed by Alyssa Rosenzweig and Lyude Paul, and recently attracted other contributors such as "Tomeu Vizoso":
Development can be followed on "Alyssas's blog":
89 1 Wolfgang Wiedmeyer
90 24 dl lud
h3. Qualcomm Adreno with freedreno
91 1 Wolfgang Wiedmeyer
not used by a supported device
93 9 Wolfgang Wiedmeyer
freedreno is actively developed. Linux kernel component is available in mainline since version 3.12. It needs to be investigated how well freedreno could work on potential target devices. However, even when using freedreno, non-free firmware is very likely still needed.
Generally speaking, Qualcomm devices have a lot of blobs and no modem isolation which is the reason why no Qualcomm-based device is yet supported by Replicant. See [[TargetsEvaluation]] for some analysis. We have not yet identified a Qualcomm-based device that would be a promising target for Replicant and where freedreno could be used on.
99 15 Wolfgang Wiedmeyer
100 24 dl lud
h3. Vivante GCxxxx with Etnaviv
101 15 Wolfgang Wiedmeyer
not used by a supported device
For some Vivante GCxxxx GPU variants, a free driver, Etnaviv, exists. See "wikipedia": for some details. It would be interesting to investigate devices using such a GPU if they would be good Replicant targets. It also needs to be checked if non-free firmware needs to be loaded to the GPU.