egl: let each platform decided how to handle LIBGL_ALWAYS_SOFTWARE
authorEric Engestrom <eric.engestrom@imgtec.com>
Wed, 20 Dec 2017 15:53:08 +0000 (15:53 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 27 Dec 2017 22:31:38 +0000 (22:31 +0000)
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@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reported-by: Brendan King <Brendan.King@imgtec.com>
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/platform_android.c
src/egl/drivers/dri2/platform_drm.c

index 7cc9f20ba2597577d9f0c326fdc256ba026f5672..d5a4f72e86a828efe60d5e02a906f13b13405c4e 100644 (file)
@@ -910,10 +910,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) {
    case _EGL_PLATFORM_SURFACELESS:
       ret = dri2_initialize_surfaceless(drv, disp);
index 7cf03b3467f285e3611747d2391426a140c8c308..1b3092b7b3bf43324c9e354bb6f664712fe24bf6 100644 (file)
@@ -1179,6 +1179,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));
index 416fd4cc657bb975e3781c1a243af536c00fb34c..a2d18ef508938c7ec355b2c2e7b00113ebe8ec59 100644 (file)
@@ -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);