From 40a9f08dd34948264ba5b533da5373a0a51ad3f1 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 26 Dec 2023 01:43:36 +0100 Subject: [PATCH] backends/drm: allow up to two composited frames to be pending at the same time This should improve responsiveness on setups where rendering each frame takes longer than the refresh cycle of the display. BUG: 452119 CCBUG: 454098 --- src/backends/drm/drm_output.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backends/drm/drm_output.cpp b/src/backends/drm/drm_output.cpp index b17c96f2be..6905da5d63 100644 --- a/src/backends/drm/drm_output.cpp +++ b/src/backends/drm/drm_output.cpp @@ -36,6 +36,7 @@ namespace KWin { static const bool s_allowColorspaceIntel = qEnvironmentVariableIntValue("KWIN_DRM_ALLOW_INTEL_COLORSPACE") == 1; +static const bool s_disableTripleBuffering = qEnvironmentVariableIntValue("KWIN_DRM_DISABLE_TRIPLE_BUFFERING") == 1; DrmOutput::DrmOutput(const std::shared_ptr &conn) : DrmAbstractOutput(conn->gpu()) @@ -44,6 +45,9 @@ DrmOutput::DrmOutput(const std::shared_ptr &conn) { m_pipeline->setOutput(this); m_renderLoop->setRefreshRate(m_pipeline->mode()->refreshRate()); + if (m_gpu->atomicModeSetting() && !s_disableTripleBuffering) { + m_renderLoop->setMaxPendingFrameCount(2); + } Capabilities capabilities = Capability::Dpms | Capability::IccProfile; State initialState;