backends/drm: don't update outputs from within DrmGpu

DrmBackend::updateOutputs may delete DrmGpu objects, so calling it from within
a DrmGpu method can cause problems

BUG: 483008
FIXED-IN: 6.1.0
wilder/Plasma/6.2
Xaver Hugl 2 years ago
parent 1866e70fe3
commit b232e80319
  1. 5
      src/backends/drm/drm_backend.cpp
  2. 2
      src/backends/drm/drm_gpu.cpp

@ -95,8 +95,11 @@ bool DrmBackend::initialize()
}
});
connect(m_session, &Session::deviceResumed, this, [this](dev_t deviceId) {
if (const auto gpu = findGpu(deviceId)) {
if (const auto gpu = findGpu(deviceId); gpu && !gpu->isActive()) {
gpu->setActive(true);
// the output list might've changed while the device was inactive
// note that this might delete the gpu!
updateOutputs();
}
});

@ -718,8 +718,6 @@ void DrmGpu::setActive(bool active)
for (const auto &output : std::as_const(m_drmOutputs)) {
output->renderLoop()->uninhibit();
}
// 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()) {

Loading…
Cancel
Save