From 47c08d6f6660e71747c32e45c4dd3ac1eb9251c2 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Fri, 24 Jun 2022 02:52:32 +0200 Subject: [PATCH] backends/drm: ensure modeset properties are reset properly Without this, all atomic modeset commits fail on setups with a VR headset --- src/backends/drm/drm_pipeline.cpp | 9 +++++++-- src/backends/drm/drm_pipeline.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index be3ec02199..540b6ce634 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -170,13 +170,17 @@ DrmPipeline::Error DrmPipeline::commitPipelinesAtomic(const QVectorsetPending(DrmCrtc::PropertyIndex::VrrEnabled, m_pending.syncMode == RenderLoopPrivate::SyncMode::Adaptive); m_pending.crtc->setPending(DrmCrtc::PropertyIndex::Gamma_LUT, m_pending.gamma ? m_pending.gamma->blobId() : 0); @@ -302,6 +306,7 @@ void DrmPipeline::atomicCommitSuccessful(CommitMode mode) } } if (mode != CommitMode::Test) { + m_pending.needsModeset = false; if (activePending()) { m_pageflipPending = true; } diff --git a/src/backends/drm/drm_pipeline.h b/src/backends/drm/drm_pipeline.h index 3ca5e5397d..8c29fbedaf 100644 --- a/src/backends/drm/drm_pipeline.h +++ b/src/backends/drm/drm_pipeline.h @@ -173,6 +173,7 @@ private: QMap> formats; bool active = true; // whether or not the pipeline should be currently used bool enabled = true; // whether or not the pipeline needs a crtc + bool needsModeset = false; std::shared_ptr mode; uint32_t overscan = 0; Output::RgbRange rgbRange = Output::RgbRange::Automatic;