egl+glx: turn LIBGL_DRI3_DISABLE into a boolean
authorEric Engestrom <eric.engestrom@imgtec.com>
Fri, 8 Sep 2017 10:55:14 +0000 (11:55 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Tue, 12 Sep 2017 12:53:12 +0000 (13:53 +0100)
Instead of setting based on set/unset, allow users to use boolean values.
In the docs, use `DISABLE=true` instead of `DISABLE=1` as it's clearer IMO.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
docs/envvars.html
src/egl/drivers/dri2/platform_x11.c
src/glx/glxext.c

index aeb5ff284784d74e63c0603f8da482a7a4939a79..89563e363615768994fe6aee8a8a9877e2afd07a 100644 (file)
@@ -34,7 +34,7 @@ sometimes be useful for debugging end-user issues.
 <li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
 <li>LIBGL_SHOW_FPS - print framerate to stdout based on the number of glXSwapBuffers
     calls per second.
-<li>LIBGL_DRI3_DISABLE - disable DRI3 if set (the value does not matter)
+<li>LIBGL_DRI3_DISABLE - disable DRI3 if set to `true`.
 </ul>
 
 
index 5d5eea3773b5d68cb2c540a5de5e5229e0cce7f8..d80eee2969a8acb3b26cd98c940a54865d10c2f4 100644 (file)
@@ -1461,7 +1461,7 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp)
 
    if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false)) {
 #ifdef HAVE_DRI3
-      if (!getenv("LIBGL_DRI3_DISABLE"))
+      if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
          initialized = dri2_initialize_x11_dri3(drv, disp);
 #endif
 
index 40219397129219695a99a0470cc496bc9e2ea209..5f23d3717a4282b40b3167f92337bc7ff6e187fe 100644 (file)
@@ -920,7 +920,7 @@ __glXInitialize(Display * dpy)
 #if defined(GLX_USE_DRM)
    if (glx_direct && glx_accel) {
 #if defined(HAVE_DRI3)
-      if (!getenv("LIBGL_DRI3_DISABLE"))
+      if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
          dpyPriv->dri3Display = dri3_create_display(dpy);
 #endif /* HAVE_DRI3 */
       dpyPriv->dri2Display = dri2CreateDisplay(dpy);