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>
/* 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)