From 0c453739b1da4f0e0075fdaf2894e70b17271ef4 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Wed, 29 Jun 2022 20:52:05 +0200 Subject: [PATCH] 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 --- src/backends/drm/drm_object_connector.cpp | 4 ++-- src/backends/drm/drm_object_connector.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backends/drm/drm_object_connector.cpp b/src/backends/drm/drm_object_connector.cpp index 9bfc997b86..6d149e21ac 100644 --- a/src/backends/drm/drm_object_connector.cpp +++ b/src/backends/drm/drm_object_connector.cpp @@ -434,13 +434,13 @@ QList> 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 DrmConnector::generateMode(const QSize &size, uint32_t refreshRate) +std::shared_ptr DrmConnector::generateMode(const QSize &size, float refreshRate) { auto modeInfo = libxcvt_gen_mode_info(size.width(), size.height(), refreshRate, false, false); diff --git a/src/backends/drm/drm_object_connector.h b/src/backends/drm/drm_object_connector.h index b3be336a2e..16726c3e19 100644 --- a/src/backends/drm/drm_object_connector.h +++ b/src/backends/drm/drm_object_connector.h @@ -106,7 +106,7 @@ public: private: QList> generateCommonModes(); - std::shared_ptr generateMode(const QSize &size, uint32_t refreshRate); + std::shared_ptr generateMode(const QSize &size, float refreshRate); std::unique_ptr m_pipeline; DrmUniquePtr m_conn;