Commit e195d429 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: ensure pipeline mode is always in the connector mode list

The current mode of an output not being in its mode list can lead to crashes
parent a9d51ab2
Pipeline #225350 passed with stage
in 14 minutes and 16 seconds
......@@ -321,10 +321,16 @@ bool DrmConnector::updateProperties()
m_modes.clear();
m_modes.append(m_driverModes);
m_modes.append(generateCommonModes());
if (!m_pipeline->mode()) {
if (m_pipeline->mode()) {
if (const auto mode = findMode(*m_pipeline->mode()->nativeMode())) {
m_pipeline->setMode(mode);
} else {
m_pipeline->setMode(m_modes.constFirst());
}
} else {
m_pipeline->setMode(m_modes.constFirst());
m_pipeline->applyPendingChanges();
}
m_pipeline->applyPendingChanges();
if (m_pipeline->output()) {
m_pipeline->output()->updateModes();
}
......
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