summaryrefslogtreecommitdiff
path: root/src/helpers/sync/SyncTimeline.cpp
diff options
context:
space:
mode:
authormavonarx <75391689+mavonarx@users.noreply.github.com>2025-07-23 23:11:07 +0200
committerGitHub <noreply@github.com>2025-07-23 23:11:07 +0200
commitecc04e8ba7469fb01c5a066bf1c48d5cd58d1a18 (patch)
treec6d86285afe39f3d8fbbf63d33ed62e065713e91 /src/helpers/sync/SyncTimeline.cpp
parentc51c6e38ac04295a4a6ad45b19bef1dbcdd6478f (diff)
drm: check syncobj timeline support before advertising protocol (#11117)
Prevents crashes on systems where DRM driver lacks syncobj timeline support (e.g., Apple Silicon with Honeykrisp driver). Applications like Zed and WezTerm would crash with 'Timeline failed importing' when trying to use explicit sync. Fixes #8158 #8803 --------- Co-authored-by: mvonarx <matthias.vonarx@sitrox.com>
Diffstat (limited to 'src/helpers/sync/SyncTimeline.cpp')
-rw-r--r--src/helpers/sync/SyncTimeline.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/helpers/sync/SyncTimeline.cpp b/src/helpers/sync/SyncTimeline.cpp
index 1b089caa..614a7c5b 100644
--- a/src/helpers/sync/SyncTimeline.cpp
+++ b/src/helpers/sync/SyncTimeline.cpp
@@ -1,12 +1,16 @@
#include "SyncTimeline.hpp"
#include "../../defines.hpp"
#include "../../managers/eventLoop/EventLoopManager.hpp"
+#include "../../Compositor.hpp"
#include <xf86drm.h>
#include <sys/eventfd.h>
using namespace Hyprutils::OS;
SP<CSyncTimeline> CSyncTimeline::create(int drmFD_) {
+ if (!g_pCompositor->supportsDrmSyncobjTimeline())
+ return nullptr;
+
auto timeline = SP<CSyncTimeline>(new CSyncTimeline);
timeline->m_drmFD = drmFD_;
timeline->m_self = timeline;
@@ -20,6 +24,9 @@ SP<CSyncTimeline> CSyncTimeline::create(int drmFD_) {
}
SP<CSyncTimeline> CSyncTimeline::create(int drmFD_, CFileDescriptor&& drmSyncobjFD) {
+ if (!g_pCompositor->supportsDrmSyncobjTimeline())
+ return nullptr;
+
auto timeline = SP<CSyncTimeline>(new CSyncTimeline);
timeline->m_drmFD = drmFD_;
timeline->m_syncobjFD = std::move(drmSyncobjFD);