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>
This commit is contained in:
Leandro Ribeiro 2021-11-30 12:00:51 -03:00 committed by Marge Bot
parent 3fa2220838
commit 81361490ef
1 changed files with 3 additions and 0 deletions

View File

@ -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)