summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2017-10-19 13:13:00 +0200
committerRobert Foss <robert.foss@collabora.com>2017-10-19 18:59:37 +0200
commit3c94d47cc1376bc3a1f20177d85a9dfb7b5a7766 (patch)
treebc75587da547bb29f2549ac432f069d39f63b093
parent7c42b4e15263082c8359f22d08d27ca6e922e634 (diff)
downloadandroid-frameworks-native-3c94d47cc1376bc3a1f20177d85a9dfb7b5a7766.tar.gz
android-frameworks-native-3c94d47cc1376bc3a1f20177d85a9dfb7b5a7766.tar.xz
egl/android: Add Android property for forcing kms_swrast
In order to simplify Android bringup on new devices, provide the property "debug.egl.force_software" which forces kms_swrast to be used. Signed-off-by: Robert Foss <robert.foss@collabora.com>
-rw-r--r--src/egl/drivers/dri2/platform_android.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 7082152..e94f54d 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -34,6 +34,8 @@
#include <stdbool.h>
#include <sync/sync.h>
+#include <cutils/properties.h>
+
#include "loader.h"
#include "egl_dri2.h"
#include "egl_dri2_fallbacks.h"
@@ -1166,11 +1168,15 @@ EGLBoolean
dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)
{
EGLBoolean initialized = EGL_TRUE;
+ char force_software_prop[PROPERTY_VALUE_MAX];
+
+ property_get("debug.egl.force_software", force_software_prop, "0");
+ int hw_accel = strcmp(force_software_prop, "1");
- initialized = dri2_initialize_android_drm(drv, true, disp);
+ initialized = dri2_initialize_android_drm(drv, hw_accel, disp);
/* Retry using software driver if it hasn't been tried yet. */
- if (!initialized)
+ if (!initialized && hw_accel)
initialized = dri2_initialize_android_drm(drv, false, disp);
return initialized;