Commit 6d9d4c19 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: fix enabled+inactive check

When dpms disabled outputs get set active, they require a modeset. If after
that they are set inactive again without resetting the pipelines first,
they no longer require a modeset but still have the pending properties that
would enable a crtc - but without a framebuffer set.

To prevent this, first test the current setup as it is, and only then see
if the pipelines would work if enabled again.
parent 9dbd0c4b
Pipeline #194058 passed with stage
in 33 minutes and 27 seconds
......@@ -432,22 +432,22 @@ bool DrmGpu::testPendingConfiguration()
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->active()) {
pipeline->setActive(true);
inactivePipelines << pipeline;
}
}
std::copy_if(m_pipelines.constBegin(), m_pipelines.constEnd(), std::back_inserter(inactivePipelines), [](const auto pipeline) {
return pipeline->enabled() && !pipeline->active();
});
const auto unused = unusedObjects();
bool test = DrmPipeline::commitPipelines(m_pipelines, DrmPipeline::CommitMode::Test, unused);
// disable inactive pipelines again
for (const auto &pipeline : qAsConst(inactivePipelines)) {
pipeline->setActive(false);
}
if (!inactivePipelines.isEmpty() && test) {
// ensure that pipelines that are set as enabled but currently inactive
// still work when they need to be set active again
for (const auto pipeline : qAsConst(inactivePipelines)) {
pipeline->setActive(true);
}
test = DrmPipeline::commitPipelines(m_pipelines, DrmPipeline::CommitMode::Test, unused);
for (const auto pipeline : qAsConst(inactivePipelines)) {
pipeline->setActive(false);
}
}
return test;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment