egl/wayland: avoid unnecessary roundtrip when authenticated
authorSimon Ser <contact@emersion.fr>
Fri, 19 Mar 2021 08:17:44 +0000 (09:17 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Mar 2021 14:45:33 +0000 (14:45 +0000)
When the compositor advertises a render node, we don't need to
perform DRM authentication. Skip the unnecessary roundtrip in this
case.

Signed-off-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9704>

src/egl/drivers/dri2/platform_wayland.c

index f65d9e4..26b6711 100644 (file)
@@ -1524,7 +1524,8 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp)
    if (roundtrip(dri2_dpy) < 0 || dri2_dpy->fd == -1)
       goto cleanup;
 
-   if (roundtrip(dri2_dpy) < 0 || !dri2_dpy->authenticated)
+   if (!dri2_dpy->authenticated &&
+       (roundtrip(dri2_dpy) < 0 || !dri2_dpy->authenticated))
       goto cleanup;
 
    dri2_dpy->fd = loader_get_user_preferred_fd(dri2_dpy->fd,