Mesa (master): egl/android: use software rendering when appropriate

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 27 17:39:50 UTC 2019


Module: Mesa
Branch: master
Commit: a87096b79e649ab554e802cc5cb19817b26e9ad6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a87096b79e649ab554e802cc5cb19817b26e9ad6

Author: Gurchetan Singh <gurchetansingh at chromium.org>
Date:   Wed Mar 13 10:59:59 2019 -0700

egl/android: use software rendering when appropriate

Now the init logic fallbacks to or forces software rendering.

v2: simplify flow (@eric)

Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>

---

 src/egl/drivers/dri2/platform_android.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index b6d58338d46..e25a6f73ed8 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1545,14 +1545,11 @@ EGLBoolean
 dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)
 {
    _EGLDevice *dev;
+   bool device_opened = false;
    struct dri2_egl_display *dri2_dpy;
    const char *err;
    int ret;
 
-   /* Not supported yet */
-   if (disp->Options.ForceSoftware)
-      return EGL_FALSE;
-
    dri2_dpy = calloc(1, sizeof(*dri2_dpy));
    if (!dri2_dpy)
       return _eglError(EGL_BAD_ALLOC, "eglInitialize");
@@ -1566,8 +1563,12 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)
    }
 
    disp->DriverData = (void *) dri2_dpy;
+   if (!disp->Options.ForceSoftware)
+      device_opened = droid_open_device(disp, false);
+   if (!device_opened)
+      device_opened = droid_open_device(disp, true);
 
-   if (!droid_open_device(disp, false)) {
+   if (!device_opened) {
       err = "DRI2: failed to open device";
       goto cleanup;
    }




More information about the mesa-commit mailing list