egl/wayland: simplify dri2_initialize_wayland()
authorEric Engestrom <eric@engestrom.ch>
Mon, 17 Aug 2020 18:32:12 +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_wayland.c

index a443ee0e3f9d6e3a95cc3e15be8ed6f8dbb8f380..cd43fb26d5e849d322613ba81f4bc427217f9acb 100644 (file)
@@ -2098,16 +2098,10 @@ dri2_initialize_wayland_swrast(_EGLDisplay *disp)
 EGLBoolean
 dri2_initialize_wayland(_EGLDisplay *disp)
 {
-   EGLBoolean initialized = EGL_FALSE;
-
-   if (!disp->Options.ForceSoftware)
-      initialized = dri2_initialize_wayland_drm(disp);
-
-   if (!initialized)
-      initialized = dri2_initialize_wayland_swrast(disp);
-
-   return initialized;
-
+   if (disp->Options.ForceSoftware)
+      return dri2_initialize_wayland_swrast(disp);
+   else
+      return dri2_initialize_wayland_drm(disp);
 }
 
 void