From baaec88e2f3d60a94610ea8c1cd067ffefe1099b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Wed, 14 Aug 2024 23:00:36 -0600 Subject: [PATCH] linux-drm-syncobj-v1: actually use the requested version --- types/wlr_linux_drm_syncobj_v1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/wlr_linux_drm_syncobj_v1.c b/types/wlr_linux_drm_syncobj_v1.c index bc2c79dc..c30274e0 100644 --- a/types/wlr_linux_drm_syncobj_v1.c +++ b/types/wlr_linux_drm_syncobj_v1.c @@ -424,6 +424,8 @@ static bool check_syncobj_eventfd(int drm_fd) { struct wlr_linux_drm_syncobj_manager_v1 *wlr_linux_drm_syncobj_manager_v1_create( struct wl_display *display, uint32_t version, int drm_fd) { + assert(version <= LINUX_DRM_SYNCOBJ_V1_VERSION); + if (!check_syncobj_eventfd(drm_fd)) { wlr_log(WLR_INFO, "DRM syncobj eventfd unavailable, disabling linux-drm-syncobj-v1"); return NULL; @@ -441,7 +443,7 @@ struct wlr_linux_drm_syncobj_manager_v1 *wlr_linux_drm_syncobj_manager_v1_create manager->global = wl_global_create(display, &wp_linux_drm_syncobj_manager_v1_interface, - LINUX_DRM_SYNCOBJ_V1_VERSION, manager, manager_bind); + version, manager, manager_bind); if (manager->global == NULL) { goto error_drm_fd; }