egl: set UseFallback if LIBGL_ALWAYS_SOFTWARE is set
authorEric Engestrom <eric.engestrom@imgtec.com>
Wed, 18 Oct 2017 16:04:27 +0000 (17:04 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Wed, 18 Oct 2017 16:25:41 +0000 (17:25 +0100)
Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/egl/drivers/dri2/platform_surfaceless.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c
src/egl/main/egldriver.c

index 2af4a40b1a6b87edb9d20edc66e8150f4ae03f29..977b046016665aa9914853d2ab8d1cc8b9427d85 100644 (file)
@@ -36,7 +36,6 @@
 #include "egl_dri2.h"
 #include "egl_dri2_fallbacks.h"
 #include "loader.h"
-#include "util/debug.h"
 
 static __DRIimage*
 surfaceless_alloc_image(struct dri2_egl_display *dri2_dpy,
@@ -325,7 +324,7 @@ dri2_initialize_surfaceless(_EGLDriver *drv, _EGLDisplay *disp)
    dri2_dpy->fd = -1;
    disp->DriverData = (void *) dri2_dpy;
 
-   if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false)) {
+   if (!disp->Options.UseFallback) {
       driver_loaded = surfaceless_probe_device(disp, false);
       if (!driver_loaded)
          _eglLog(_EGL_WARNING,
index 14db55ca747b07fa23f5e8d721a4cbc639292c6a..b38eb1c3354cfb0c5015c319e4d59d915a1672bd 100644 (file)
@@ -42,7 +42,6 @@
 #include "egl_dri2.h"
 #include "egl_dri2_fallbacks.h"
 #include "loader.h"
-#include "util/debug.h"
 #include "util/u_vector.h"
 #include "eglglobals.h"
 
@@ -1972,7 +1971,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
 {
    EGLBoolean initialized = EGL_FALSE;
 
-   if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false))
+   if (!disp->Options.UseFallback)
       initialized = dri2_initialize_wayland_drm(drv, disp);
 
    if (!initialized)
index 9c20ea8f8a98c4c2b6bd19efedaeff4899b92242..5bcdb2dac748cc0e99012ffa2d4b35eb384907e8 100644 (file)
@@ -1460,7 +1460,7 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp)
 {
    EGLBoolean initialized = EGL_FALSE;
 
-   if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false)) {
+   if (!disp->Options.UseFallback) {
 #ifdef HAVE_DRI3
       if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
          initialized = dri2_initialize_x11_dri3(drv, disp);
index 33f8f57aeb11e06f92f2c5623207f1cd2289850b..1ff37850e05f729dd35a9536c805c8dd4d17530f 100644 (file)
@@ -44,6 +44,8 @@
 #include "egldriver.h"
 #include "egllog.h"
 
+#include "util/debug.h"
+
 static mtx_t _eglModuleMutex = _MTX_INITIALIZER_NP;
 static _EGLDriver *_eglDriver;
 
@@ -86,7 +88,8 @@ _eglMatchDriver(_EGLDisplay *dpy)
    assert(!dpy->Initialized);
 
    /* set options */
-   dpy->Options.UseFallback = EGL_FALSE;
+   dpy->Options.UseFallback =
+      env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
 
    best_drv = _eglMatchAndInitialize(dpy);
    if (!best_drv) {