backends/drm: release buffers for disabled objects

BUG: 456686
This commit is contained in:
Xaver Hugl 2022-08-12 17:21:58 +02:00
parent a6cc4b557b
commit f4e917f734
2 changed files with 10 additions and 2 deletions

View file

@ -187,6 +187,7 @@ void DrmPlane::disable()
{
setPending(PropertyIndex::CrtcId, 0);
setPending(PropertyIndex::FbId, 0);
m_next = nullptr;
}
void DrmPlane::releaseBuffers()

View file

@ -165,8 +165,15 @@ DrmPipeline::Error DrmPipeline::commitPipelinesAtomic(const QVector<DrmPipeline
return errnoToError();
}
std::for_each(pipelines.begin(), pipelines.end(), std::mem_fn(&DrmPipeline::atomicModesetSuccessful));
std::for_each(unusedObjects.begin(), unusedObjects.end(), std::mem_fn(&DrmObject::commitPending));
std::for_each(unusedObjects.begin(), unusedObjects.end(), std::mem_fn(&DrmObject::commit));
for (const auto &obj : unusedObjects) {
obj->commitPending();
obj->commit();
if (auto crtc = dynamic_cast<DrmCrtc *>(obj)) {
crtc->flipBuffer();
} else if (auto plane = dynamic_cast<DrmPlane *>(obj)) {
plane->flipBuffer();
}
}
return Error::None;
}
case CommitMode::Test: {