backends/drm: disable added outputs if finding a working setup fails

If the non-working outputs stay enabled, that may cause problems.
This commit is contained in:
Xaver Hugl 2022-04-12 15:20:26 +02:00
parent 255e9882b6
commit adb46cbfa3

View file

@ -250,6 +250,7 @@ bool DrmGpu::updateOutputs()
}
// check for added and removed connectors
QVector<DrmOutput *> addedOutputs;
QVector<DrmConnector *> removedConnectors = m_connectors;
for (int i = 0; i < resources->count_connectors; ++i) {
const uint32_t currentConnector = resources->connectors[i];
@ -284,6 +285,7 @@ bool DrmGpu::updateOutputs()
auto output = new DrmOutput(conn->pipeline());
m_drmOutputs << output;
m_outputs << output;
addedOutputs << output;
Q_EMIT outputAdded(output);
}
}
@ -332,6 +334,11 @@ bool DrmGpu::updateOutputs()
for (const auto &pipeline : qAsConst(m_pipelines)) {
pipeline->revertPendingChanges();
}
for (const auto &output : qAsConst(addedOutputs)) {
output->setEnabled(false);
output->pipeline()->pending.enabled = false;
output->pipeline()->applyPendingChanges();
}
}
m_leaseDevice->setDrmMaster(true);
return true;