Commit 29bc1173 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: ignore enabled state of outputs for the lifetime of surfaces

A buffer is needed for atomic tests before the output is actually enabled

BUG: 450501
CCBUG: 450358
(cherry picked from commit e9db27d0)
parent 58976057
Pipeline #139564 passed with stage
in 13 minutes and 54 seconds
......@@ -50,8 +50,8 @@ EglGbmBackend::EglGbmBackend(DrmBackend *drmBackend, DrmGpu *gpu)
, m_gpu(gpu)
{
m_gpu->setEglBackend(this);
connect(m_gpu, &DrmGpu::outputEnabled, this, &EglGbmBackend::addOutput);
connect(m_gpu, &DrmGpu::outputDisabled, this, &EglGbmBackend::removeOutput);
connect(m_backend, &DrmBackend::outputAdded, this, &EglGbmBackend::addOutput);
connect(m_backend, &DrmBackend::outputRemoved, this, &EglGbmBackend::removeOutput);
setIsDirectRendering(true);
}
......@@ -207,8 +207,9 @@ bool EglGbmBackend::resetOutput(Output &output)
return true;
}
bool EglGbmBackend::addOutput(DrmAbstractOutput *drmOutput)
bool EglGbmBackend::addOutput(AbstractOutput *output)
{
const auto drmOutput = static_cast<DrmAbstractOutput*>(output);
Output newOutput;
newOutput.output = drmOutput;
if (!isPrimary() && !renderingBackend()->addOutput(drmOutput)) {
......@@ -218,16 +219,16 @@ bool EglGbmBackend::addOutput(DrmAbstractOutput *drmOutput)
return true;
}
void EglGbmBackend::removeOutput(DrmAbstractOutput *drmOutput)
void EglGbmBackend::removeOutput(AbstractOutput *output)
{
Q_ASSERT(m_outputs.contains(drmOutput));
Q_ASSERT(m_outputs.contains(output));
if (isPrimary()) {
// shadow buffer needs context current for destruction
makeCurrent();
} else {
renderingBackend()->removeOutput(drmOutput);
renderingBackend()->removeOutput(output);
}
m_outputs.remove(drmOutput);
m_outputs.remove(output);
}
bool EglGbmBackend::swapBuffers(DrmAbstractOutput *drmOutput, const QRegion &dirty)
......
......@@ -118,8 +118,8 @@ private:
bool doesRenderFit(const Output &output, const Output::RenderData &render);
bool resetOutput(Output &output);
bool addOutput(DrmAbstractOutput *output);
void removeOutput(DrmAbstractOutput *output);
bool addOutput(AbstractOutput *output);
void removeOutput(AbstractOutput *output);
bool makeContextCurrent(const Output::RenderData &output) const;
void setViewport(const Output &output) const;
......
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