summaryrefslogtreecommitdiff
path: root/src/egl
diff options
context:
space:
mode:
authorLeandro Ribeiro <leandro.ribeiro@collabora.com>2021-11-30 12:00:51 -0300
committerMarge Bot <emma+marge@anholt.net>2021-12-02 14:18:55 +0000
commit81361490efd6cf0fcf84a6fd6e6419dd9c54e9dc (patch)
treeb8df4c12211a7cbf340320497518ea2948b506dd /src/egl
parent3fa2220838ad8b039bc46900ee57b4c107bd2a77 (diff)
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@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13985>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c3
1 files changed, 3 insertions, 0 deletions
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)