backends/drm: fail presentation if there's no buffer for it yet

BUG: 474483
This commit is contained in:
Xaver Hugl 2023-09-13 13:37:53 +02:00
parent c7ddf987a1
commit 87cee87aff

View file

@ -231,6 +231,9 @@ bool DrmPipeline::prepareAtomicPresentation(DrmAtomicCommit *commit)
}
const auto fb = m_primaryLayer->currentBuffer();
if (!fb) {
return false;
}
m_pending.crtc->primaryPlane()->set(commit, QPoint(0, 0), fb->buffer()->size(), centerBuffer(fb->buffer()->size(), m_pending.mode->size()));
commit->addBuffer(m_pending.crtc->primaryPlane(), fb);
return true;
@ -374,7 +377,9 @@ bool DrmPipeline::updateCursor()
}
// test the full state, to take pending commits into account
auto fullState = std::make_unique<DrmAtomicCommit>(QVector<DrmPipeline *>{this});
prepareAtomicPresentation(fullState.get());
if (!prepareAtomicPresentation(fullState.get())) {
return false;
}
prepareAtomicCursor(fullState.get());
if (!fullState->test()) {
return false;