From a6cd30333cf875c3bd374ebeb8c7bdc4cf115a62 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 19 Mar 2021 09:17:44 +0100 Subject: [PATCH] egl/wayland: avoid unnecessary roundtrip when authenticated 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 Part-of: --- src/egl/drivers/dri2/platform_wayland.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index f65d9e4..26b6711 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -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, -- 2.7.4