backends/drm: force a modeset after tty switches with legacy

We don't know what the current mode is, or if the display is even enabled
or whatever. Always do a modeset to be sure everything is correct

BUG: 469280
This commit is contained in:
Xaver Hugl 2023-05-17 17:31:55 +02:00
parent d3c82fa103
commit ecc66a03d0
3 changed files with 12 additions and 0 deletions

View file

@ -702,6 +702,12 @@ void DrmGpu::setActive(bool active)
}
// while the session was inactive, the output list may have changed
m_platform->updateOutputs();
for (const auto &output : std::as_const(m_drmOutputs)) {
// force a modeset with legacy, we can't reliably know if one is needed
if (!atomicModeSetting()) {
output->pipeline()->forceLegacyModeset();
}
}
} else {
for (const auto &output : std::as_const(m_drmOutputs)) {
output->renderLoop()->inhibit();

View file

@ -72,6 +72,7 @@ public:
Error present();
bool testScanout();
bool maybeModeset();
void forceLegacyModeset();
bool needsModeset() const;
void applyPendingChanges();

View file

@ -43,6 +43,11 @@ DrmPipeline::Error DrmPipeline::presentLegacy()
return Error::None;
}
void DrmPipeline::forceLegacyModeset()
{
legacyModeset();
}
DrmPipeline::Error DrmPipeline::legacyModeset()
{
uint32_t connId = m_connector->id();