Revert "egl: drop EGL driver `name`"
[mesa.git] / src / egl / main / egldriver.c
index 33f8f57aeb11e06f92f2c5623207f1cd2289850b..9d77cb6e97b5454542275b814013398c52f2ba60 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) {
@@ -95,6 +98,8 @@ _eglMatchDriver(_EGLDisplay *dpy)
    }
 
    if (best_drv) {
+      _eglLog(_EGL_DEBUG, "the best driver is %s",
+            best_drv->Name);
       dpy->Driver = best_drv;
       dpy->Initialized = EGL_TRUE;
    }