diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index e83ba06ef8..0a8ae7bb34 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -108,6 +108,16 @@ DrmPipeline::Error DrmPipeline::commitPipelines(const QVector &pi DrmPipeline::Error DrmPipeline::commitPipelinesAtomic(const QVector &pipelines, CommitMode mode, const QVector &unusedObjects) { auto commit = std::make_unique(pipelines); + if (mode == CommitMode::Test) { + // if there's a modeset pending, the tests on top of that state + // also have to allow modesets or they'll always fail + const bool wantsModeset = std::any_of(pipelines.begin(), pipelines.end(), [](DrmPipeline *pipeline) { + return pipeline->needsModeset(); + }); + if (wantsModeset) { + mode = CommitMode::TestAllowModeset; + } + } for (const auto &pipeline : pipelines) { if (pipeline->activePending()) { if (!pipeline->m_pending.layer->checkTestBuffer()) {