summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfshooks.h
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2013-01-14 16:26:03 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-22 09:24:40 +0100
commit4f14b42f7dc289cd73a5e7aa934d6052c708bac3 (patch)
tree998a1b751318c16dcba0a2cafec03982a73ad152 /src/plugins/platforms/eglfs/qeglfshooks.h
parent25c90050974714b5582df5ef9609be4efe4e771a (diff)
Add support for forced VSYNC using the EGLFS platform plugin.
Before a buffer swap the new QEglFSHooks::waitForVSync method is called which looks at QT_QPA_EGLFS_FORCEVSYNC and - if that is set and non-null - calls ioctl with the FBIO_WAITFORVSYNC request on the framebuffer device. This is required on some embedded platforms where the driver does not support VSYNC yet the Kernel provides a generic implementation. I tested this using QML_RENDER_TIMING=1 which proofs that the frame rate for an example of mine drops from >125fps to a straight ~60fps with a few frames that take ~33ms (i.e. 30fps) as expected for VSYNC. To prevent excessive open/close calls on the frame buffer device per frame, the file descriptor is now cached. To keep the QEglFSHooks interface as clean as possible this is done via a global static in qeglfshooks_stub.cpp and initialized and freed in platformInit and platformDestroy. Change-Id: I4d31b227c65ff22aa089db0fbc62c89a59cbb6c7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfshooks.h')
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfshooks.h b/src/plugins/platforms/eglfs/qeglfshooks.h
index f3b6a28e70..fc1ee16073 100644
--- a/src/plugins/platforms/eglfs/qeglfshooks.h
+++ b/src/plugins/platforms/eglfs/qeglfshooks.h
@@ -69,6 +69,7 @@ public:
virtual bool hasCapability(QPlatformIntegration::Capability cap) const;
virtual QEglFSCursor *createCursor(QEglFSScreen *screen) const;
virtual bool filterConfig(EGLDisplay display, EGLConfig config) const;
+ virtual void waitForVSync() const;
virtual const char *fbDeviceName() const;
};