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
This commit is contained in:
Xaver Hugl 2024-03-03 19:05:55 +01:00
parent 9e77e5038f
commit da80dd4c84

View file

@ -71,7 +71,7 @@ std::shared_ptr<DrmBlob> 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()