Mesa (17.3): egl: let each platform decided how to handle LIBGL_ALWAYS_SOFTWARE

Emil Velikov evelikov at kemper.freedesktop.org
Thu Jan 4 14:09:16 UTC 2018


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

Author: Eric Engestrom <eric.engestrom at imgtec.com>
Date:   Wed Dec 20 15:53:08 2017 +0000

egl: let each platform decided how to handle LIBGL_ALWAYS_SOFTWARE

My refactor in 47273d7312cb5b5b6b0b9 missed this early return; because
of it, setting UseFallback one layer above actually prevented the
software path from being used.

Remove this early return and let each platform's dri2_initialize_*()
decide what it can do with the LIBGL_ALWAYS_SOFTWARE restriction.

platform_{surfaceless,x11,wayland} were already handling it themselves.

Fixes: 47273d7312cb5b5b6b0b9 "egl: set UseFallback if LIBGL_ALWAYS_SOFTWARE is set"
Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Reported-by: Brendan King <Brendan.King at imgtec.com>
(cherry picked from commit 2f421651aca9c0a308c8a632d1847bbd0598e294)

---

 src/egl/drivers/dri2/egl_dri2.c         | 4 ----
 src/egl/drivers/dri2/platform_android.c | 4 ++++
 src/egl/drivers/dri2/platform_drm.c     | 4 ++++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 503450542e..a32d025c00 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -904,10 +904,6 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
       return EGL_TRUE;
    }
 
-   /* not until swrast_dri is supported */
-   if (disp->Options.UseFallback)
-      return EGL_FALSE;
-
    switch (disp->Platform) {
 #ifdef HAVE_SURFACELESS_PLATFORM
    case _EGL_PLATFORM_SURFACELESS:
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index e390365b8b..a85f4b0b9f 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1142,6 +1142,10 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
    const char *err;
    int ret;
 
+   /* Not supported yet */
+   if (disp->Options.UseFallback)
+      return EGL_FALSE;
+
    loader_set_logger(_eglLog);
 
    dri2_dpy = calloc(1, sizeof(*dri2_dpy));
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 9005f5dd9e..c78f52363e 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -652,6 +652,10 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
    struct gbm_device *gbm;
    const char *err;
 
+   /* Not supported yet */
+   if (disp->Options.UseFallback)
+      return EGL_FALSE;
+
    loader_set_logger(_eglLog);
 
    dri2_dpy = calloc(1, sizeof *dri2_dpy);




More information about the mesa-commit mailing list