X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fegl%2Fmain%2Fegldriver.c;h=218b3daef25bf476c601d074183178cb835c647d;hb=b8b3517a49555b5127776272848d8689327db960;hp=5d5b7daa41811a601e8b0409246928c3c532c1e0;hpb=9690759d0ccadd9527dee892eedc2f9d4baadf59;p=mesa.git diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index 5d5b7daa418..218b3daef25 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -44,6 +44,8 @@ #include "egldriver.h" #include "egllog.h" +#include "util/debug.h" + static mtx_t _eglModuleMutex = _MTX_INITIALIZER_NP; static _EGLDriver *_eglDriver; @@ -71,34 +73,31 @@ _eglMatchAndInitialize(_EGLDisplay *dpy) } /** - * Match a display to a driver. The display is initialized unless test_only is - * true. The matching is done by finding the first driver that can initialize - * the display. + * Match a display to a driver. The matching is done by finding the first + * driver that can initialize the display. */ _EGLDriver * -_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only) +_eglMatchDriver(_EGLDisplay *dpy) { _EGLDriver *best_drv; assert(!dpy->Initialized); /* set options */ - dpy->Options.TestOnly = test_only; - dpy->Options.UseFallback = EGL_FALSE; + dpy->Options.ForceSoftware = + env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); best_drv = _eglMatchAndInitialize(dpy); - if (!best_drv) { - dpy->Options.UseFallback = EGL_TRUE; + if (!best_drv && !dpy->Options.ForceSoftware) { + dpy->Options.ForceSoftware = EGL_TRUE; best_drv = _eglMatchAndInitialize(dpy); } if (best_drv) { - _eglLog(_EGL_DEBUG, "the best driver is %s%s", - best_drv->Name, (test_only) ? " (test only) " : ""); - if (!test_only) { - dpy->Driver = best_drv; - dpy->Initialized = EGL_TRUE; - } + _eglLog(_EGL_DEBUG, "the best driver is %s", + best_drv->Name); + dpy->Driver = best_drv; + dpy->Initialized = EGL_TRUE; } return best_drv;