dont crash on multigpu lol

This commit is contained in:
Vaxry 2024-07-06 18:11:31 +02:00
parent e09e76aa4a
commit 2fd901321e
2 changed files with 6 additions and 3 deletions

View file

@ -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); });

View file

@ -176,7 +176,10 @@ bool CSyncTimeline::importFromSyncFileFD(uint64_t dst, int fd) {
}
bool CSyncTimeline::transfer(SP<CSyncTimeline> 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");