From 78498c8987a8fddf2e8486f20c68ac2717a50f08 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 6 Jul 2024 18:11:31 +0200 Subject: [PATCH] dont crash on multigpu lol --- src/helpers/Monitor.cpp | 4 ++-- src/helpers/sync/SyncTimeline.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index a43b6e2e5..b8e5a0d63 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -31,8 +31,8 @@ CMonitor::~CMonitor() { void CMonitor::onConnect(bool noRule) { if (output->supportsExplicit) { - inTimeline = CSyncTimeline::create(g_pCompositor->m_iDRMFD); - outTimeline = CSyncTimeline::create(g_pCompositor->m_iDRMFD); + inTimeline = CSyncTimeline::create(output->getBackend()->drmFD()); + outTimeline = CSyncTimeline::create(output->getBackend()->drmFD()); } listeners.frame = output->events.frame.registerListener([this](std::any d) { Events::listener_monitorFrame(this, nullptr); }); diff --git a/src/helpers/sync/SyncTimeline.cpp b/src/helpers/sync/SyncTimeline.cpp index 1a7286e00..d3c1b4161 100644 --- a/src/helpers/sync/SyncTimeline.cpp +++ b/src/helpers/sync/SyncTimeline.cpp @@ -176,7 +176,10 @@ bool CSyncTimeline::importFromSyncFileFD(uint64_t dst, int fd) { } bool CSyncTimeline::transfer(SP from, uint64_t fromPoint, uint64_t toPoint) { - ASSERT(from->drmFD == drmFD); + if (drmFD != from->drmFD) { + Debug::log(ERR, "CSyncTimeline::transfer: cannot transfer timelines between gpus"); + return false; + } if (drmSyncobjTransfer(drmFD, handle, toPoint, from->handle, fromPoint, 0)) { Debug::log(ERR, "CSyncTimeline::transfer: drmSyncobjTransfer failed");