loader/wayland: Add named queue fallback

If libwayland isn't new enough to create event queues with names, just
throw away the name. It's just a debug feature anyway.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27824>
This commit is contained in:
Derek Foreman
2024-02-09 11:05:36 -06:00
committed by Marge Bot
parent 4e219a22e2
commit eb1235f343
3 changed files with 22 additions and 1 deletions

View File

@@ -2020,6 +2020,12 @@ if with_platform_wayland
dependencies: dep_wayland_client) dependencies: dep_wayland_client)
pre_args += ['-DHAVE_WL_DISPATCH_QUEUE_TIMEOUT'] pre_args += ['-DHAVE_WL_DISPATCH_QUEUE_TIMEOUT']
endif endif
if cc.has_function(
'wl_display_create_queue_with_name',
prefix : '#include <wayland-client.h>',
dependencies: dep_wayland_client)
pre_args += ['-DHAVE_WL_CREATE_QUEUE_WITH_NAME']
endif
endif endif
dep_x11 = null_dep dep_x11 = null_dep

View File

@@ -133,3 +133,11 @@ wl_display_dispatch_queue_timeout(struct wl_display *display,
return ret; return ret;
} }
#endif #endif
#ifndef HAVE_WL_CREATE_QUEUE_WITH_NAME
struct wl_event_queue *
wl_display_create_queue_with_name(struct wl_display *display, const char *name)
{
return wl_display_create_queue(display);
}
#endif

View File

@@ -23,9 +23,10 @@
#ifndef LOADER_WAYLAND_HELPER_HEADER_H #ifndef LOADER_WAYLAND_HELPER_HEADER_H
#define LOADER_WAYLAND_HELPER_HEADER_H #define LOADER_WAYLAND_HELPER_HEADER_H
#include <wayland-client.h>
#ifndef HAVE_WL_DISPATCH_QUEUE_TIMEOUT #ifndef HAVE_WL_DISPATCH_QUEUE_TIMEOUT
#include <wayland-client.h>
#include <util/timespec.h> #include <util/timespec.h>
int int
wl_display_dispatch_queue_timeout(struct wl_display *display, wl_display_dispatch_queue_timeout(struct wl_display *display,
@@ -33,4 +34,10 @@ wl_display_dispatch_queue_timeout(struct wl_display *display,
const struct timespec *deadline); const struct timespec *deadline);
#endif #endif
#ifndef HAVE_WL_CREATE_QUEUE_WITH_NAME
struct wl_event_queue *
wl_display_create_queue_with_name(struct wl_display *display,
const char *name);
#endif
#endif #endif