diff options
author | Robert Foss <robert.foss@collabora.com> | 2018-07-24 11:09:37 +0200 |
---|---|---|
committer | Joonas Kylmälä <joonas.kylmala@iki.fi> | 2019-02-09 16:55:57 -0500 |
commit | 0c5ba2cebfe6504ca46b9162a34d027939666d08 (patch) | |
tree | 710b34b224da2e5e9727260574601193861f9bde | |
parent | 616e19d4bf6bb17bcb06ddd8984b11d72363499c (diff) | |
download | external_mesa3d-0c5ba2cebfe6504ca46b9162a34d027939666d08.tar.gz external_mesa3d-0c5ba2cebfe6504ca46b9162a34d027939666d08.tar.bz2 external_mesa3d-0c5ba2cebfe6504ca46b9162a34d027939666d08.zip |
egl/android: Add Android property for forcing software rendering
In order to simplify Android bringup on new devices,
provide the property "drm.gpu.force_software" which
forces kms_swrast to be used.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
-rw-r--r-- | src/egl/main/egldriver.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index 218b3daef25..46814448f3d 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -39,6 +39,10 @@ #include <stdlib.h> #include "c11/threads.h" +#ifdef HAVE_ANDROID_PLATFORM +#include <cutils/properties.h> +#endif + #include "egldefines.h" #include "egldisplay.h" #include "egldriver.h" @@ -87,6 +91,12 @@ _eglMatchDriver(_EGLDisplay *dpy) dpy->Options.ForceSoftware = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); +#ifdef HAVE_ANDROID_PLATFORM + char prop_val[PROPERTY_VALUE_MAX]; + property_get("drm.gpu.force_software", prop_val, "0"); + dpy->Options.ForceSoftware |= strncmp(prop_val, "0", PROPERTY_VALUE_MAX) != 0; +#endif + best_drv = _eglMatchAndInitialize(dpy); if (!best_drv && !dpy->Options.ForceSoftware) { dpy->Options.ForceSoftware = EGL_TRUE; |