mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-22 23:40:23 +01:00
egl/x11: cleanup init code
No functional change, just rewriting it in an easier-to-understand way. Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
47351b843a
commit
08fc74663b
1 changed files with 11 additions and 15 deletions
|
|
@ -1467,25 +1467,21 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
EGLBoolean
|
||||
dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
{
|
||||
EGLBoolean initialized = EGL_TRUE;
|
||||
EGLBoolean initialized = EGL_FALSE;
|
||||
|
||||
int x11_dri2_accel = (getenv("LIBGL_ALWAYS_SOFTWARE") == NULL);
|
||||
if (!getenv("LIBGL_ALWAYS_SOFTWARE")) {
|
||||
#ifdef HAVE_DRI3
|
||||
if (!getenv("LIBGL_DRI3_DISABLE"))
|
||||
initialized = dri2_initialize_x11_dri3(drv, disp);
|
||||
#endif
|
||||
|
||||
if (x11_dri2_accel) {
|
||||
#ifdef HAVE_DRI3
|
||||
if (getenv("LIBGL_DRI3_DISABLE") != NULL ||
|
||||
!dri2_initialize_x11_dri3(drv, disp)) {
|
||||
#endif
|
||||
if (!dri2_initialize_x11_dri2(drv, disp)) {
|
||||
initialized = dri2_initialize_x11_swrast(drv, disp);
|
||||
}
|
||||
#ifdef HAVE_DRI3
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
initialized = dri2_initialize_x11_swrast(drv, disp);
|
||||
if (!initialized)
|
||||
initialized = dri2_initialize_x11_dri2(drv, disp);
|
||||
}
|
||||
|
||||
if (!initialized)
|
||||
initialized = dri2_initialize_x11_swrast(drv, disp);
|
||||
|
||||
return initialized;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue