backend/drm: Set timeline support based on capability

We assumed that all atomic backends supported syncobj, but gud does not.
Instead, query DRM_CAP_SYNCOBJ_TIMELINE when using the atomic backend.
This commit is contained in:
Kenny Levinsen 2024-11-07 17:23:28 +01:00
parent c0945b6613
commit 014023c14f
2 changed files with 1 additions and 1 deletions

View File

@ -271,7 +271,6 @@ struct wlr_backend *wlr_drm_backend_create(struct wlr_session *session,
} }
} }
drm->backend.features.timeline = drm->iface != &legacy_iface;
if (drm->parent) { if (drm->parent) {
drm->backend.features.timeline = drm->backend.features.timeline && drm->backend.features.timeline = drm->backend.features.timeline &&
drm->mgpu_renderer.wlr_rend->features.timeline; drm->mgpu_renderer.wlr_rend->features.timeline;

View File

@ -124,6 +124,7 @@ bool check_drm_features(struct wlr_drm_backend *drm) {
drm->supports_tearing_page_flips = drmGetCap(drm->fd, DRM_CAP_ASYNC_PAGE_FLIP, &cap) == 0 && cap == 1; drm->supports_tearing_page_flips = drmGetCap(drm->fd, DRM_CAP_ASYNC_PAGE_FLIP, &cap) == 0 && cap == 1;
} else { } else {
drm->supports_tearing_page_flips = drmGetCap(drm->fd, DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP, &cap) == 0 && cap == 1; drm->supports_tearing_page_flips = drmGetCap(drm->fd, DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP, &cap) == 0 && cap == 1;
drm->backend.features.timeline = drmGetCap(drm->fd, DRM_CAP_SYNCOBJ_TIMELINE, &cap) == 0 && cap == 1;
} }
if (env_parse_bool("WLR_DRM_NO_MODIFIERS")) { if (env_parse_bool("WLR_DRM_NO_MODIFIERS")) {