Commit 52c1155b authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: prevent calling frameFailed multiple times per present

parent 972534eb
Pipeline #161372 passed with stage
in 18 minutes and 45 seconds
......@@ -320,14 +320,15 @@ bool DrmOutput::present()
setVrrPolicy(RenderLoop::VrrPolicy::Never);
}
}
if (m_pipeline->present()) {
bool modeset = gpu()->needsModeset();
if (modeset ? m_pipeline->maybeModeset() : m_pipeline->present()) {
Q_EMIT outputChange(m_pipeline->pending.layer->currentDamage());
return true;
} else {
} else if (!modeset) {
qCWarning(KWIN_DRM) << "Presentation failed!" << strerror(errno);
frameFailed();
return false;
}
return false;
}
int DrmOutput::gammaRampSize() const
......
......@@ -61,10 +61,6 @@ bool DrmPipeline::testScanout()
bool DrmPipeline::present()
{
Q_ASSERT(pending.crtc);
if (gpu()->needsModeset()) {
m_modesetPresentPending = true;
return gpu()->maybeModeset();
}
if (gpu()->atomicModeSetting()) {
return commitPipelines({this}, CommitMode::Commit);
} else {
......@@ -79,6 +75,12 @@ bool DrmPipeline::present()
return true;
}
bool DrmPipeline::maybeModeset()
{
m_modesetPresentPending = true;
return gpu()->maybeModeset();
}
bool DrmPipeline::commitPipelines(const QVector<DrmPipeline *> &pipelines, CommitMode mode, const QVector<DrmObject *> &unusedObjects)
{
Q_ASSERT(!pipelines.isEmpty());
......
......@@ -63,6 +63,7 @@ public:
*/
bool present();
bool testScanout();
bool maybeModeset();
bool needsModeset() const;
void applyPendingChanges();
......
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