[Replicant] [vendor/replicant][PATCH 1/2] Always use libagl for system binaries that are too slow with LLVMpipe

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Thu Jan 2 13:44:26 UTC 2020

From: Andrés Domínguez <andresdju at gmail.com>

When using LLVMpipe by default, some system binaries are too
slow to make the device usable.

This overrides the OpenGL implementation for the following
- bootanimation
- surfaceflinger
- system_server

When loading a binary, the EGL loader will then check if
there is an empty file corresponding to the cmdline in
/system/etc/libGLES_android and use libagl if it exists.

For instance to make SurfaceFlinger use libagl, we first
need to look at /proc/<pid>/cmdline. Here it returns
/system/bin/surfaceflinger. Once we have that, we can then
create the following empty file to make it use libagl:

Signed-off-by: Andrés Domínguez <andresdju at gmail.com>
GNUtoo at cyberdimension.org: squashed commits, commit message: added background
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
 config/common.mk                                              | 4 ++++
 prebuilt/common/etc/libGLES_android/system/bin/bootanimation  | 0
 prebuilt/common/etc/libGLES_android/system/bin/surfaceflinger | 0
 prebuilt/common/etc/libGLES_android/system_server             | 0
 4 files changed, 4 insertions(+)
 create mode 100644 prebuilt/common/etc/libGLES_android/system/bin/bootanimation
 create mode 100644 prebuilt/common/etc/libGLES_android/system/bin/surfaceflinger
 create mode 100644 prebuilt/common/etc/libGLES_android/system_server

diff --git a/config/common.mk b/config/common.mk
index 09e63090..5731df08 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -90,6 +90,10 @@ PRODUCT_COPY_FILES += \
+# Copy default EGL overrides
+    $(call find-copy-subdir-files,*,vendor/replicant/prebuilt/common/etc/libGLES_android,system/etc/libGLES_android)
 # Include CM audio files
 include vendor/replicant/config/cm_audio.mk
diff --git a/prebuilt/common/etc/libGLES_android/system/bin/bootanimation b/prebuilt/common/etc/libGLES_android/system/bin/bootanimation
new file mode 100644
index 00000000..e69de29b
diff --git a/prebuilt/common/etc/libGLES_android/system/bin/surfaceflinger b/prebuilt/common/etc/libGLES_android/system/bin/surfaceflinger
new file mode 100644
index 00000000..e69de29b
diff --git a/prebuilt/common/etc/libGLES_android/system_server b/prebuilt/common/etc/libGLES_android/system_server
new file mode 100644
index 00000000..e69de29b

More information about the Replicant mailing list