mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
wayland: avoid writing interface names as free-form strings
Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Simon Ser <contact@emersion.fr> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18335>
This commit is contained in:
parent
6d34925967
commit
33426a328b
4 changed files with 7 additions and 7 deletions
|
|
@ -471,7 +471,7 @@ v3dv_registry_global(void *data,
|
|||
uint32_t version)
|
||||
{
|
||||
struct v3dv_wayland_info *info = data;
|
||||
if (strcmp(interface, "wl_drm") == 0) {
|
||||
if (strcmp(interface, wl_drm_interface.name) == 0) {
|
||||
info->wl_drm = wl_registry_bind(registry, name, &wl_drm_interface,
|
||||
MIN2(version, 2));
|
||||
wl_drm_add_listener(info->wl_drm, &v3dv_drm_listener, data);
|
||||
|
|
|
|||
|
|
@ -1931,10 +1931,10 @@ registry_handle_global_drm(void *data, struct wl_registry *registry,
|
|||
{
|
||||
struct dri2_egl_display *dri2_dpy = data;
|
||||
|
||||
if (strcmp(interface, "wl_drm") == 0) {
|
||||
if (strcmp(interface, wl_drm_interface.name) == 0) {
|
||||
dri2_dpy->wl_drm_version = MIN2(version, 2);
|
||||
dri2_dpy->wl_drm_name = name;
|
||||
} else if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0 && version >= 3) {
|
||||
} else if (strcmp(interface, zwp_linux_dmabuf_v1_interface.name) == 0 && version >= 3) {
|
||||
dri2_dpy->wl_dmabuf =
|
||||
wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface,
|
||||
MIN2(version, ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION));
|
||||
|
|
@ -2614,7 +2614,7 @@ registry_handle_global_swrast(void *data, struct wl_registry *registry,
|
|||
{
|
||||
struct dri2_egl_display *dri2_dpy = data;
|
||||
|
||||
if (strcmp(interface, "wl_shm") == 0) {
|
||||
if (strcmp(interface, wl_shm_interface.name) == 0) {
|
||||
dri2_dpy->wl_shm =
|
||||
wl_registry_bind(registry, name, &wl_shm_interface, 1);
|
||||
wl_shm_add_listener(dri2_dpy->wl_shm, &shm_listener, dri2_dpy);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ device_select_registry_global(void *data, struct wl_registry *registry, uint32_t
|
|||
const char *interface, uint32_t version)
|
||||
{
|
||||
struct device_select_wayland_info *info = data;
|
||||
if (strcmp(interface, "wl_drm") == 0) {
|
||||
if (strcmp(interface, wl_drm_interface.name) == 0) {
|
||||
info->wl_drm = wl_registry_bind(registry, name, &wl_drm_interface, MIN2(version, 2));
|
||||
wl_drm_add_listener(info->wl_drm, &ds_drm_listener, data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -489,14 +489,14 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
|||
struct wsi_wl_display *display = data;
|
||||
|
||||
if (display->sw) {
|
||||
if (strcmp(interface, "wl_shm") == 0) {
|
||||
if (strcmp(interface, wl_shm_interface.name) == 0) {
|
||||
display->wl_shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
|
||||
wl_shm_add_listener(display->wl_shm, &shm_listener, display);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0 && version >= 3) {
|
||||
if (strcmp(interface, zwp_linux_dmabuf_v1_interface.name) == 0 && version >= 3) {
|
||||
display->wl_dmabuf =
|
||||
wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface, 3);
|
||||
zwp_linux_dmabuf_v1_add_listener(display->wl_dmabuf,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue