backends/drm: drop DrmGpu test mode

It's unused
master
Xaver Hugl 2 years ago
parent 8cb8d2f627
commit 3d556bba83

@ -395,7 +395,7 @@ bool DrmGpu::checkCrtcAssignment(QVector<DrmConnector *> connectors, const QVect
return false;
}
bool DrmGpu::testPendingConfiguration(TestMode mode)
bool DrmGpu::testPendingConfiguration()
{
QVector<DrmConnector *> connectors;
for (const auto &conn : qAsConst(m_connectors)) {
@ -417,14 +417,7 @@ bool DrmGpu::testPendingConfiguration(TestMode mode)
return c1->getProp(DrmConnector::PropertyIndex::CrtcId)->current() > c2->getProp(DrmConnector::PropertyIndex::CrtcId)->current();
});
}
const auto &test = [&connectors, &crtcs, this, mode]() {
if (mode == TestMode::TestWithCrtcReallocation) {
return checkCrtcAssignment(connectors, crtcs);
} else {
return testPipelines();
}
};
if (test()) {
if (checkCrtcAssignment(connectors, crtcs)) {
return true;
} else {
// try again without hw rotation
@ -433,7 +426,7 @@ bool DrmGpu::testPendingConfiguration(TestMode mode)
hwRotationUsed |= (pipeline->pending.bufferTransformation != DrmPlane::Transformations(DrmPlane::Transformation::Rotate0));
pipeline->pending.bufferTransformation = DrmPlane::Transformation::Rotate0;
}
return hwRotationUsed ? test() : false;
return hwRotationUsed ? checkCrtcAssignment(connectors, crtcs) : false;
}
}

@ -81,11 +81,7 @@ public:
DrmVirtualOutput *createVirtualOutput(const QString &name, const QSize &size, double scale, VirtualOutputMode mode);
void removeVirtualOutput(DrmVirtualOutput *output);
enum class TestMode {
TestOnly,
TestWithCrtcReallocation
};
bool testPendingConfiguration(TestMode mode = TestMode::TestWithCrtcReallocation);
bool testPendingConfiguration();
bool needsModeset() const;
bool maybeModeset();

@ -296,7 +296,7 @@ void DrmOutput::updateModes()
if (currentMode != m_pipeline->pending.mode) {
// DrmConnector::findCurrentMode might fail
m_pipeline->pending.mode = currentMode ? currentMode : m_pipeline->connector()->modes().constFirst();
if (m_gpu->testPendingConfiguration(DrmGpu::TestMode::TestWithCrtcReallocation)) {
if (m_gpu->testPendingConfiguration()) {
m_pipeline->applyPendingChanges();
setCurrentModeInternal(m_pipeline->pending.mode->size(), m_pipeline->pending.mode->refreshRate());
m_renderLoop->setRefreshRate(m_pipeline->pending.mode->refreshRate());

Loading…
Cancel
Save