From b1ade2c096f9b83cf6310d1029d13c067b077c84 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 12 Oct 2024 17:11:32 +0200 Subject: [PATCH] backend/drm: fix timeline feature flag on multi-GPU setups This piece of code checks for multi-GPU renderer support, so it needs to run after the renderer is initialized. Fixes: 514c4b4cce01 ("backend: add timeline feature flag") Closes: https://github.com/swaywm/sway/issues/8382 --- backend/drm/backend.c | 6 ++++++ backend/drm/drm.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/drm/backend.c b/backend/drm/backend.c index d166f467..7f93e755 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -264,6 +264,12 @@ struct wlr_backend *wlr_drm_backend_create(struct wlr_session *session, } } + drm->backend.features.timeline = drm->iface != &legacy_iface; + if (drm->parent) { + drm->backend.features.timeline = drm->backend.features.timeline && + drm->mgpu_renderer.wlr_rend->features.timeline; + } + drm->session_destroy.notify = handle_session_destroy; wl_signal_add(&session->events.destroy, &drm->session_destroy); diff --git a/backend/drm/drm.c b/backend/drm/drm.c index e6a6c5cb..b7457ad0 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -126,12 +126,6 @@ bool check_drm_features(struct wlr_drm_backend *drm) { drm->supports_tearing_page_flips = drmGetCap(drm->fd, DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP, &cap) == 0 && cap == 1; } - drm->backend.features.timeline = drm->iface != &legacy_iface; - if (drm->parent) { - drm->backend.features.timeline = drm->backend.features.timeline && - drm->mgpu_renderer.wlr_rend->features.timeline; - } - if (env_parse_bool("WLR_DRM_NO_MODIFIERS")) { wlr_log(WLR_DEBUG, "WLR_DRM_NO_MODIFIERS set, disabling modifiers"); } else {