backends/drm: fix common mode generation

The unit for refresh rate was wrong, which caused insanely high as well
as negative refresh rates

BUG: 455477
This commit is contained in:
Xaver Hugl 2022-06-29 20:52:05 +02:00
parent a6d72d3f60
commit 0c453739b1
2 changed files with 3 additions and 3 deletions

View file

@ -434,13 +434,13 @@ QList<std::shared_ptr<DrmConnectorMode>> DrmConnector::generateCommonModes()
return mode->size() == size;
});
if (it == m_driverModes.constEnd() && size.width() <= maxSize.width() && size.height() <= maxSize.height() && bandwidthEstimation < maxBandwidthEstimation) {
ret << generateMode(size, 60000);
ret << generateMode(size, 60);
}
}
return ret;
}
std::shared_ptr<DrmConnectorMode> DrmConnector::generateMode(const QSize &size, uint32_t refreshRate)
std::shared_ptr<DrmConnectorMode> DrmConnector::generateMode(const QSize &size, float refreshRate)
{
auto modeInfo = libxcvt_gen_mode_info(size.width(), size.height(), refreshRate, false, false);

View file

@ -106,7 +106,7 @@ public:
private:
QList<std::shared_ptr<DrmConnectorMode>> generateCommonModes();
std::shared_ptr<DrmConnectorMode> generateMode(const QSize &size, uint32_t refreshRate);
std::shared_ptr<DrmConnectorMode> generateMode(const QSize &size, float refreshRate);
std::unique_ptr<DrmPipeline> m_pipeline;
DrmUniquePtr<drmModeConnector> m_conn;