Mesa (master): egl/wayland: avoid unnecessary roundtrip when authenticated

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Mar 19 15:01:41 UTC 2021


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

Author: Simon Ser <contact at emersion.fr>
Date:   Fri Mar 19 09:17:44 2021 +0100

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 <contact at emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9704>

---

 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 f65d9e45d8f..26b6711952c 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,



More information about the mesa-commit mailing list