diff options
author | Eric Engestrom <[email protected]> | 2017-09-08 11:52:01 +0100 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2017-09-12 13:53:11 +0100 |
commit | 5c68ea29f31283768c8e1b631eb812d1e74cb5c3 (patch) | |
tree | f37325b713cf841ac49ea6e0cb372b5619473d1d /src/egl/drivers | |
parent | f4a9d205d8a6474defa86dc4f12b7e63e61a49d9 (diff) |
egl+glx: turn LIBGL_ALWAYS_SOFTWARE into a boolean
Instead of setting based on set/unset, allow users to use boolean values.
In the docs, use `ALWAYS=true` instead of `ALWAYS=1` as it's clearer IMO.
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 3 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index bf2adbf63bd..eb10a7dd137 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -42,6 +42,7 @@ #include "egl_dri2.h" #include "egl_dri2_fallbacks.h" #include "loader.h" +#include "util/debug.h" #include "util/u_vector.h" #include "eglglobals.h" @@ -1940,7 +1941,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp) { EGLBoolean initialized = EGL_TRUE; - int hw_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL); + bool hw_accel = !env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); if (hw_accel) { if (!dri2_initialize_wayland_drm(drv, disp)) { diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 5ca5b912dab..5d5eea3773b 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -40,6 +40,7 @@ #endif #include <sys/types.h> #include <sys/stat.h> +#include "util/debug.h" #include "util/macros.h" #include "egl_dri2.h" @@ -1458,7 +1459,7 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp) { EGLBoolean initialized = EGL_FALSE; - if (!getenv("LIBGL_ALWAYS_SOFTWARE")) { + if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false)) { #ifdef HAVE_DRI3 if (!getenv("LIBGL_DRI3_DISABLE")) initialized = dri2_initialize_x11_dri3(drv, disp); |