Mesa (master): egl/x11: simplify dri2_initialize_x11()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 1 18:46:31 UTC 2020


Module: Mesa
Branch: master
Commit: 8e259dad4cf4848883d1e349c6fdd2f3ed1fdcdc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e259dad4cf4848883d1e349c6fdd2f3ed1fdcdc

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Mon Aug 17 20:32:45 2020 +0200

egl/x11: simplify dri2_initialize_x11()

eglInitialize() already handles the "retry using the software path"
logic, there's no need to repeat it here.

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

---

 src/egl/drivers/dri2/platform_x11.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 96a8a88d725..b8011866234 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -1520,22 +1520,16 @@ dri2_initialize_x11_dri2(_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
-      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
 
-      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



More information about the mesa-commit mailing list