Mesa (main): egl/wayland: do not try to bind to wl_drm if not advertised

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 2 14:58:23 UTC 2021


Module: Mesa
Branch: main
Commit: 81361490efd6cf0fcf84a6fd6e6419dd9c54e9dc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=81361490efd6cf0fcf84a6fd6e6419dd9c54e9dc

Author: Leandro Ribeiro <leandro.ribeiro at collabora.com>
Date:   Tue Nov 30 12:00:51 2021 -0300

egl/wayland: do not try to bind to wl_drm if not advertised

This fixes a bug that was introduced in 89d15b9a "egl/wayland: add
initial dma-buf feedback support".

Sometimes we have to fallback to wl_drm. But do not try to bind to it
when it is not advertised by the compositor.

This issue was found by n3rdopolis and reported here:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5697

Signed-off-by: Leandro Ribeiro <leandro.ribeiro at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13985>

---

 src/egl/drivers/dri2/platform_wayland.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 87751ada684..f714e211f55 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -2087,6 +2087,9 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp)
    /* We couldn't retrieve a render node from the dma-buf feedback (or the
     * feedback was not advertised at all), so we must fallback to wl_drm. */
    if (dri2_dpy->fd == -1) {
+      /* wl_drm not advertised by compositor, so can't continue */
+      if (dri2_dpy->wl_drm_name == 0)
+         goto cleanup;
       wl_drm_bind(dri2_dpy);
 
       if (dri2_dpy->wl_drm == NULL)



More information about the mesa-commit mailing list