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
This commit is contained in:
Xaver Hugl 2022-04-05 01:04:42 +02:00
parent 08324f0924
commit 661fbec244

View file

@ -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<DrmPipeline *> 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<DrmVirtualOutput *>(output)) {