mesa/src/egl
johniyoods fb0123f42e egl/dri2: require valid render fd before advertising EGL_WL_bind_wayland_display
Commit 718ef151f2 removed the legacy non-dmabuf wl_drm path and now
gates the extension on has_dmabuf_import && has_dmabuf_export. These
flags reflect driver capability and do not depend on whether a valid DRM
render fd was assigned during display initialization.
Before commit 718ef151f2, dri2_get_capabilities() returned 0 for
kms_swrast paths because can_share_buffer is false there, so the
__DRI_IMAGE_CAP_GLOBAL_NAMES check naturally excluded software-only
devices. The replacement dmabuf flags do not have this property.

On a software-only device (e.g., vgem), fd_render_gpu stays -1 and
device_name is NULL, yet both dmabuf flags are true, causing the
extension to be incorrectly advertised. When a Wayland compositor calls
eglBindWaylandDisplayWL(), drmGetRenderDeviceNameFromFd(-1) returns NULL
and strdup(device_name) is called on a NULL pointer, causing a SIGSEGV.

Add an additional guard when setting WL_bind_wayland_display,
so the extension is only advertised when a valid DRM render fd is present

Fixes: 718ef151f2 ("egl/wayland: Remove support for non-dmabuf wl_drm")

Signed-off-by: johniyoods <johniyoods@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41527>
2026-05-13 16:16:48 +00:00
..
drivers egl/dri2: require valid render fd before advertising EGL_WL_bind_wayland_display 2026-05-13 16:16:48 +00:00
generate mesa: move src/mapi to src/mesa/glapi 2025-08-06 20:35:26 +00:00
main egl: Switch to mesa_log(..) 2026-04-30 23:51:48 +00:00
wayland meson: use the wayland module 2025-09-22 16:35:26 +00:00
.clang-format clang-format: Disable formatting by default 2023-08-13 16:48:49 +02:00
egl-entrypoint-check.py egl: Apply autopep8. 2025-02-21 02:50:56 +00:00
egl-glvnd-symbols.txt egl: export GL-CL interop functions from libEGL_mesa.so 2025-06-08 13:20:47 -04:00
egl-glvnd.sym egl: export GL-CL interop functions from libEGL_mesa.so 2025-06-08 13:20:47 -04:00
egl-symbols.txt egl/dri2: Implement the new flush method 2022-11-02 18:11:41 +00:00
egl.sym egl/meson: Specify which symbols to export 2025-01-15 23:18:36 +00:00
meson.build meson: Add support for buidling zink + Turnip/KGSL 2026-03-31 15:00:29 +00:00