From 83d797785b0a253319e4ce9a9fbe0ff55e940a20 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 24 Feb 2022 05:39:07 +0100 Subject: [PATCH] backends/drm: wait for pending pageflips before doing a modeset If we don't, KWin may get a pageflip event for an output that is already considered as being turned off --- src/backends/drm/drm_gpu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backends/drm/drm_gpu.cpp b/src/backends/drm/drm_gpu.cpp index e08ba399bc..e316334a0b 100644 --- a/src/backends/drm/drm_gpu.cpp +++ b/src/backends/drm/drm_gpu.cpp @@ -733,6 +733,8 @@ bool DrmGpu::maybeModeset() // commit only once all pipelines are ready for presentation return true; } + // make sure there's no pending pageflips + waitIdle(); const bool ok = DrmPipeline::commitPipelines(pipelines, DrmPipeline::CommitMode::CommitModeset, unusedObjects()); for (DrmPipeline *pipeline : qAsConst(pipelines)) { if (pipeline->modesetPresentPending()) {