Commit ea8b0d96 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.


(cherry picked from commit 6d9d4c19)
parent cb5981a1
Pipeline #194059 passed with stage
in 31 minutes and 1 second
......@@ -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