egl/wayland: Use MIN2 for wl_drm version
authorDaniel Stone <daniels@collabora.com>
Sat, 10 Jun 2017 13:54:44 +0000 (14:54 +0100)
committerDaniel Stone <daniels@collabora.com>
Fri, 14 Jul 2017 13:14:05 +0000 (14:14 +0100)
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 <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_wayland.c

index b3574e03b28974aaab9b502a89bbefa0e2ed7a5a..ee68284217b444f32a2f5143c64e31ad9de720a3 100644 (file)
@@ -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);
    }
 }