Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yousong/6ea62e1b26e618109495490b7d859d42 to your computer and use it in GitHub Desktop.
Save yousong/6ea62e1b26e618109495490b7d859d42 to your computer and use it in GitHub Desktop.
From 40429a3a60dd3f3d7a04cc6934d8bd28db4edc61 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Fri, 20 Apr 2018 15:54:37 +0800
Subject: [PATCH] emulator: load libGLES_android.so from /system dir
Existence of /vendor/lib64/egl/ will cause qemu.gles to be set to 2.
Which will result in the libGLES_android.so to have no chance to be
loaded at all. It's part of the frameworks anyway, so treble should not
be an issue.
Fixes 3adf9e1403 ("emulator: update EGL emulation library path").
Change-Id: Ic76ed1a0f8d2a824cf9de74f20fda3198c28da38
---
opengl/libs/EGL/Loader.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 91a34558a..b479af36f 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -327,9 +327,9 @@ static void* load_system_driver(const char* kind) {
switch (emulationStatus) {
case 0:
#if defined(__LP64__)
- result = "/vendor/lib64/egl/libGLES_android.so";
+ result = "/system/lib64/egl/libGLES_android.so";
#else
- result = "/vendor/lib/egl/libGLES_android.so";
+ result = "/system/lib/egl/libGLES_android.so";
#endif
return result;
case 1:
--
2.16.2
From cfb6338cfd458fc2f47b2dc16b5209e89f1c8c92 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Tue, 24 Apr 2018 17:58:07 +0800
Subject: [PATCH] graphics: switch to swiftshader for non-arm64 devices
libGLES_android.so is now rejected by SurfaceFlinger which requires at
least OpenGL ES 2.0. Swiftshader at the moment does not support arm64
---
graphics/device.mk | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/graphics/device.mk b/graphics/device.mk
index 267bc2f..0c7b8e3 100644
--- a/graphics/device.mk
+++ b/graphics/device.mk
@@ -1,7 +1,15 @@
PRODUCT_PROPERTY_OVERRIDES := $(if $(CONFIG_SW_GRAPHICS), \
ro.kernel.qemu=1)
-PRODUCT_PACKAGES := libGLES_android
+ifeq ($(TARGET_ARCH),arm64)
+ PRODUCT_PACKAGES := \
+ libGLES_android
+else
+ PRODUCT_PACKAGES := \
+ libEGL_swiftshader \
+ libGLESv1_CM_swiftshader \
+ libGLESv2_swiftshader
+endif
PRODUCT_PROPERTY_OVERRIDES += \
ro.sf.lcd_density=$(CONFIG_DISPLAY_DPI)
--
2.16.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment