From da80dd4c8473de71e743d016791d5ddb06ff0996 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Sun, 3 Mar 2024 19:05:55 +0100 Subject: [PATCH] backends/drm: fix vblank calculation Due to some misinterpretation of mode timings, the old method calculated vsync, not vblank, so the resulting duration was much shorter, which caused frame drops on some systems. BUG: 482064 --- src/backends/drm/drm_connector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/drm/drm_connector.cpp b/src/backends/drm/drm_connector.cpp index 7abe81375e..b1ddbb8a53 100644 --- a/src/backends/drm/drm_connector.cpp +++ b/src/backends/drm/drm_connector.cpp @@ -71,7 +71,7 @@ std::shared_ptr DrmConnectorMode::blob() std::chrono::nanoseconds DrmConnectorMode::vblankTime() const { - return std::chrono::nanoseconds(((m_nativeMode.vsync_end - m_nativeMode.vsync_start) * m_nativeMode.htotal * 1'000'000ULL) / m_nativeMode.clock); + return std::chrono::nanoseconds(((m_nativeMode.vtotal - m_nativeMode.vdisplay) * m_nativeMode.htotal * 1'000'000ULL) / m_nativeMode.clock); } drmModeModeInfo *DrmConnectorMode::nativeMode()