egl: Improve driver selection.
[mesa.git] / src / egl / main / egldriver.c
index 7baa24fbf8688b5f09a20f0c2dfe1f2bf4d12fb8..e133c220f5ca8a6edd6ba953d97003f33ce4dcfe 100644 (file)
@@ -585,8 +585,13 @@ _eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only)
 
    /* set options */
    dpy->Options.TestOnly = test_only;
+   dpy->Options.UseFallback = EGL_FALSE;
 
    best_drv = _eglMatchAndInitialize(dpy);
+   if (!best_drv) {
+      dpy->Options.UseFallback = EGL_TRUE;
+      best_drv = _eglMatchAndInitialize(dpy);
+   }
 
    _eglUnlockMutex(&_eglModuleMutex);