OSDN Git Service

wayland: Also support wl_drm version 1
[android-x86/hardware-intel-common-libva.git] / va / wayland / va_wayland_drm.c
index 97dfee1..4a24a2c 100644 (file)
@@ -183,8 +183,12 @@ registry_handle_global(
     struct va_wayland_drm_context *wl_drm_ctx = data;
 
     if (strcmp(interface, "wl_drm") == 0) {
+        /* bind to at most version 2, but also support version 1 if
+         * compositor does not have v2
+         */
         wl_drm_ctx->drm =
-            wl_registry_bind(wl_drm_ctx->registry, id, wl_drm_ctx->drm_interface, 2);
+            wl_registry_bind(wl_drm_ctx->registry, id, wl_drm_ctx->drm_interface,
+                             (version < 2) ? version : 2);
     }
 }