From 83fcb107ad01ee6acc558b736b12db6bea6f7d2f Mon Sep 17 00:00:00 2001 From: Philipp Kerling Date: Tue, 13 Jun 2017 09:54:06 +0200 Subject: [PATCH] wayland: Also support wl_drm version 1 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 --- va/wayland/va_wayland_drm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/va/wayland/va_wayland_drm.c b/va/wayland/va_wayland_drm.c index 97dfee1..4a24a2c 100644 --- a/va/wayland/va_wayland_drm.c +++ b/va/wayland/va_wayland_drm.c @@ -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); } } -- 2.11.0