egl/wayland: simplify LIBGL_ALWAYS_SOFTWARE logic
authorEric Engestrom <eric.engestrom@imgtec.com>
Mon, 2 Oct 2017 10:34:52 +0000 (11:34 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Mon, 2 Oct 2017 12:10:48 +0000 (13:10 +0100)
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_wayland.c

index ae3347756bc1a4629b69f2ea669d9dc8c5223e2a..011dddfabf422f30cb6cb62315231897ee047d81 100644 (file)
@@ -1940,17 +1940,13 @@ dri2_initialize_wayland_swrast(_EGLDriver *drv, _EGLDisplay *disp)
 EGLBoolean
 dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
 {
-   EGLBoolean initialized = EGL_TRUE;
+   EGLBoolean initialized = EGL_FALSE;
 
-   bool hw_accel = !env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
+   if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false))
+      initialized = dri2_initialize_wayland_drm(drv, disp);
 
-   if (hw_accel) {
-      if (!dri2_initialize_wayland_drm(drv, disp)) {
-         initialized = dri2_initialize_wayland_swrast(drv, disp);
-      }
-   } else {
+   if (!initialized)
       initialized = dri2_initialize_wayland_swrast(drv, disp);
-   }
 
    return initialized;