egl/surfaceless: simplify dri2_initialize_surfaceless()
authorEric Engestrom <eric@engestrom.ch>
Mon, 17 Aug 2020 18:31:45 +0000 (20:31 +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_surfaceless.c

index dd283673a8374a506cfee80871916ffe8190fa7e..8bd6009f8a0c8a57eea819b7e7dcea9656203f41 100644 (file)
@@ -326,15 +326,7 @@ dri2_initialize_surfaceless(_EGLDisplay *disp)
    dri2_dpy->fd = -1;
    disp->DriverData = (void *) dri2_dpy;
 
-   if (!disp->Options.ForceSoftware) {
-      driver_loaded = surfaceless_probe_device(disp, false);
-      if (!driver_loaded)
-         _eglLog(_EGL_WARNING,
-                 "No hardware driver found, falling back to software rendering");
-   }
-
-   if (!driver_loaded)
-      driver_loaded = surfaceless_probe_device(disp, true);
+   driver_loaded = surfaceless_probe_device(disp, disp->Options.ForceSoftware);
 
    if (!driver_loaded) {
       _eglLog(_EGL_DEBUG, "Falling back to surfaceless swrast without DRM.");