From f50c78664042e9187c090cf780c88136c4158d10 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 5 Nov 2022 12:50:47 +0000 Subject: Added direct scanout --- src/events/Monitors.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/events/Monitors.cpp') diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index 427bf61d..2a0cacc5 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -109,6 +109,7 @@ void Events::listener_monitorFrame(void* owner, void* data) { static auto *const PDAMAGETRACKINGMODE = &g_pConfigManager->getConfigValuePtr("debug:damage_tracking")->intValue; static auto *const PDAMAGEBLINK = &g_pConfigManager->getConfigValuePtr("debug:damage_blink")->intValue; static auto *const PNOVFR = &g_pConfigManager->getConfigValuePtr("misc:no_vfr")->intValue; + static auto *const PNODIRECTSCANOUT = &g_pConfigManager->getConfigValuePtr("general:no_direct_scanout")->intValue; static int damageBlinkCleanup = 0; // because double-buffered @@ -154,6 +155,16 @@ void Events::listener_monitorFrame(void* owner, void* data) { g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITOR->ID); } + // Direct scanout first + if (!*PNODIRECTSCANOUT) { + if (g_pHyprRenderer->attemptDirectScanout(PMONITOR)) { + return; + } else if (g_pHyprRenderer->m_pLastScanout) { + Debug::log(LOG, "Left a direct scanout."); + g_pHyprRenderer->m_pLastScanout = nullptr; + } + } + timespec now; clock_gettime(CLOCK_MONOTONIC, &now); -- cgit v1.2.3