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
This commit is contained in:
Xaver Hugl 2023-12-26 01:43:36 +01:00
parent 1e3d50e3ff
commit 40a9f08dd3

View file

@ -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<DrmConnector> &conn)
: DrmAbstractOutput(conn->gpu())
@ -44,6 +45,9 @@ DrmOutput::DrmOutput(const std::shared_ptr<DrmConnector> &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;