From 661fbec2443e6ae1dcdc49ef9a480b3c80e7398e Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 5 Apr 2022 01:04:42 +0200 Subject: [PATCH] backends/drm: create surfaces for new pipelines before doing tests It's more efficient and avoids code paths where KWin can crash if all tests fail --- src/backends/drm/drm_gpu.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/backends/drm/drm_gpu.cpp b/src/backends/drm/drm_gpu.cpp index 3022e35ab6..d5adcf1996 100644 --- a/src/backends/drm/drm_gpu.cpp +++ b/src/backends/drm/drm_gpu.cpp @@ -313,6 +313,12 @@ bool DrmGpu::updateOutputs() plane->updateProperties(); } + for (const auto &pipeline : qAsConst(m_pipelines)) { + if (!pipeline->pending.layer) { + pipeline->pending.layer = m_platform->renderBackend()->createDrmPipelineLayer(pipeline); + pipeline->applyPendingChanges(); + } + } if (testPendingConfiguration()) { for (const auto &pipeline : qAsConst(m_pipelines)) { pipeline->applyPendingChanges(); @@ -428,9 +434,6 @@ bool DrmGpu::testPipelines() // pipelines that are enabled but not active need to be activated for the test QVector inactivePipelines; for (const auto &pipeline : qAsConst(m_pipelines)) { - if (!pipeline->pending.layer) { - pipeline->pending.layer = m_platform->renderBackend()->createDrmPipelineLayer(pipeline); - } if (!pipeline->pending.active) { pipeline->pending.active = true; inactivePipelines << pipeline; @@ -782,6 +785,7 @@ void DrmGpu::recreateSurfaces() { for (const auto &pipeline : qAsConst(m_pipelines)) { pipeline->pending.layer = m_platform->renderBackend()->createDrmPipelineLayer(pipeline); + pipeline->applyPendingChanges(); } for (const auto &output : qAsConst(m_outputs)) { if (const auto virtualOutput = qobject_cast(output)) {