From 4d4e3f64ff93cfde69d8b6ded2865a7023a812ae Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 8 Apr 2024 18:00:35 +0100 Subject: e --- src/managers/FrameSchedulingManager.cpp | 10 ++++++---- src/managers/FrameSchedulingManager.hpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/managers/FrameSchedulingManager.cpp b/src/managers/FrameSchedulingManager.cpp index 2d02f82f..fd86a37b 100644 --- a/src/managers/FrameSchedulingManager.cpp +++ b/src/managers/FrameSchedulingManager.cpp @@ -4,7 +4,7 @@ #include "eventLoop/EventLoopManager.hpp" static void onPresentTimer(std::shared_ptr self, void* data) { - g_pFrameSchedulingManager->onVblankTimer(data); + g_pFrameSchedulingManager->onVblankTimer((CMonitor*)data); } static void onFenceTimer(std::shared_ptr self, void* data) { @@ -41,7 +41,7 @@ void CFrameSchedulingManager::registerMonitor(CMonitor* pMonitor) { #endif DATA->fenceTimer = std::make_shared(::onFenceTimer, pMonitor); - DATA->vblankTimer = std::make_shared(::onPresentTimer, DATA); + DATA->vblankTimer = std::make_shared(::onPresentTimer, pMonitor); g_pEventLoopManager->addTimer(DATA->fenceTimer); g_pEventLoopManager->addTimer(DATA->vblankTimer); @@ -252,8 +252,10 @@ void CFrameSchedulingManager::renderMonitor(SSchedulingData* data) { data->rendered = true; } -void CFrameSchedulingManager::onVblankTimer(void* data) { - auto DATA = (SSchedulingData*)data; +void CFrameSchedulingManager::onVblankTimer(CMonitor* pMonitor) { + const auto DATA = dataFor(pMonitor); + + RASSERT(DATA, "No data in onVblankTimer"); if (!DATA->rendered) { // what the fuck? diff --git a/src/managers/FrameSchedulingManager.hpp b/src/managers/FrameSchedulingManager.hpp index dab00d77..1335bf7e 100644 --- a/src/managers/FrameSchedulingManager.hpp +++ b/src/managers/FrameSchedulingManager.hpp @@ -29,7 +29,7 @@ class CFrameSchedulingManager { void onPresent(CMonitor* pMonitor, wlr_output_event_present* presentationData); void onFrame(CMonitor* pMonitor); - void onVblankTimer(void* data); + void onVblankTimer(CMonitor* pMonitor); bool isMonitorUsingLegacyScheduler(CMonitor* pMonitor); -- cgit v1.2.3