diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-03-13 11:47:25 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-03-14 17:33:21 +0000 |
commit | f925c13c0125b9d8159116c9b41bb01d2702bf5f (patch) | |
tree | 6e402d8525327a00ebca36ab8d515068d55ec905 /src/plugins/platforms/eglfs/deviceintegration/eglfs_kms | |
parent | 4da66d5dbf6b1752bdaff5d13b20531608081b70 (diff) |
eglfs: Report the QScreen refresh rate from eglfs
For KMS we can always know the correct rate so report it from the backend's custom
screen implementation.
For the rest, query from the framebuffer. If the fb driver publishes the timings then
we can calculate the vertical refresh rate from them. If not, default to 60.
Task-number: QTBUG-44971
Change-Id: I854a34e7c0d652790cc2ac967715828ec76f5733
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp | 6 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp index a36ce50b76..a27819d1dd 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp @@ -303,4 +303,10 @@ void QEglFSKmsScreen::restoreMode() } } +qreal QEglFSKmsScreen::refreshRate() const +{ + quint32 refresh = m_output.modes[m_output.mode].vrefresh; + return refresh > 0 ? refresh : 60; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h index ed79d00896..16521c7fe0 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h @@ -83,6 +83,8 @@ public: QPlatformCursor *cursor() const Q_DECL_OVERRIDE; + qreal refreshRate() const Q_DECL_OVERRIDE; + QEglFSKmsDevice *device() const { return m_device; } gbm_surface *surface() const { return m_gbm_surface; } |