Just using version 2 without checking would lead to a protocol error
bringing down the entire application, and wl_drm version 1 is still
supported since v2 only adds PRIME capabilities.
Signed-off-by: Philipp Kerling <pkerling@casix.org>
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);
}
}