glx, egl: Add LIBGL_DRI2_DISABLE environment variable

For orthogonality with LIBGL_DRI3_DISABLE.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7688>
This commit is contained in:
Adam Jackson 2020-11-19 09:54:18 -05:00 committed by Marge Bot
parent 27612984a4
commit a59b1b18a9
3 changed files with 9 additions and 2 deletions

View File

@ -23,6 +23,8 @@ LibGL environment variables
``LIBGL_SHOW_FPS``
print framerate to stdout based on the number of ``glXSwapBuffers``
calls per second.
``LIBGL_DRI2_DISABLE``
disable DRI2 if set to ``true``.
``LIBGL_DRI3_DISABLE``
disable DRI3 if set to ``true``.

View File

@ -1541,7 +1541,11 @@ dri2_initialize_x11(_EGLDisplay *disp)
return EGL_TRUE;
#endif
return dri2_initialize_x11_dri2(disp);
if (!env_var_as_boolean("LIBGL_DRI2_DISABLE", false))
if (dri2_initialize_x11_dri2(disp))
return EGL_TRUE;
return EGL_FALSE;
}
void

View File

@ -926,7 +926,8 @@ __glXInitialize(Display * dpy)
if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
dpyPriv->dri3Display = dri3_create_display(dpy);
#endif /* HAVE_DRI3 */
dpyPriv->dri2Display = dri2CreateDisplay(dpy);
if (!env_var_as_boolean("LIBGL_DRI2_DISABLE", false))
dpyPriv->dri2Display = dri2CreateDisplay(dpy);
dpyPriv->driDisplay = driCreateDisplay(dpy);
}
#endif /* GLX_USE_DRM */