From ecc04e8ba7469fb01c5a066bf1c48d5cd58d1a18 Mon Sep 17 00:00:00 2001 From: mavonarx <75391689+mavonarx@users.noreply.github.com> Date: Wed, 23 Jul 2025 23:11:07 +0200 Subject: 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 --- src/helpers/sync/SyncTimeline.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/helpers/sync/SyncTimeline.cpp') 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 #include using namespace Hyprutils::OS; SP CSyncTimeline::create(int drmFD_) { + if (!g_pCompositor->supportsDrmSyncobjTimeline()) + return nullptr; + auto timeline = SP(new CSyncTimeline); timeline->m_drmFD = drmFD_; timeline->m_self = timeline; @@ -20,6 +24,9 @@ SP CSyncTimeline::create(int drmFD_) { } SP CSyncTimeline::create(int drmFD_, CFileDescriptor&& drmSyncobjFD) { + if (!g_pCompositor->supportsDrmSyncobjTimeline()) + return nullptr; + auto timeline = SP(new CSyncTimeline); timeline->m_drmFD = drmFD_; timeline->m_syncobjFD = std::move(drmSyncobjFD); -- cgit v1.2.3