From 5295df63ad7822e14e7dabfc107bc416271bfcdc Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sat, 10 Jun 2017 14:54:44 +0100 Subject: [PATCH] egl/wayland: Use MIN2 for wl_drm version Use a slightly more explicit version cap for binding wl_drm, so we can add other interfaces with different versioning schemes later. Reviewed-by: Eric Engestrom Reviewed-by: Emil Velikov --- src/egl/drivers/dri2/platform_wayland.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index b3574e03b28..ee68284217b 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -986,11 +986,9 @@ registry_handle_global_drm(void *data, struct wl_registry *registry, { struct dri2_egl_display *dri2_dpy = data; - if (version > 1) - version = 2; if (strcmp(interface, "wl_drm") == 0) { dri2_dpy->wl_drm = - wl_registry_bind(registry, name, &wl_drm_interface, version); + wl_registry_bind(registry, name, &wl_drm_interface, MIN2(version, 2)); wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy); } } -- 2.30.2