egl/x11: simplify dri2_initialize_x11()
authorEric Engestrom <eric@engestrom.ch>
Mon, 17 Aug 2020 18:32:45 +0000 (20:32 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 18:31:51 +0000 (18:31 +0000)
eglInitialize() already handles the "retry using the software path"
logic, there's no need to repeat it here.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6353>

src/egl/drivers/dri2/platform_x11.c

index 96a8a88d725da7a58b11cc482c489968be3ad433..b8011866234428725b928d6199a7e5222b32ccef 100644 (file)
@@ -1520,22 +1520,16 @@ dri2_initialize_x11_dri2(_EGLDisplay *disp)
 EGLBoolean
 dri2_initialize_x11(_EGLDisplay *disp)
 {
 EGLBoolean
 dri2_initialize_x11(_EGLDisplay *disp)
 {
-   EGLBoolean initialized = EGL_FALSE;
+   if (disp->Options.ForceSoftware)
+      return dri2_initialize_x11_swrast(disp);
 
 
-   if (!disp->Options.ForceSoftware) {
 #ifdef HAVE_DRI3
 #ifdef HAVE_DRI3
-      if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
-         initialized = dri2_initialize_x11_dri3(disp);
+   if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
+      if (dri2_initialize_x11_dri3(disp))
+         return EGL_TRUE;
 #endif
 
 #endif
 
-      if (!initialized)
-         initialized = dri2_initialize_x11_dri2(disp);
-   }
-
-   if (!initialized)
-      initialized = dri2_initialize_x11_swrast(disp);
-
-   return initialized;
+   return dri2_initialize_x11_dri2(disp);
 }
 
 void
 }
 
 void