From 9b35b0e8dc6069aed563d0aca61c973eb307d772 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Fri, 11 Mar 2016 15:05:56 +0100 Subject: Make the eglfs and eglfs-viv detection and build work for INTEGRITY. The majority of these changes is about #ifdef-ing the Linux-specific use of /dev/fb0. The display handle is also acquired using fbGetDisplay(), which is equivalent to fbGetDisplayByIndex(0) but is also portable. Change-Id: I6f460edc9c06ae7461a6aab2a816ac6f645208c4 Reviewed-by: Andy Nichols --- .../eglfs/deviceintegration/eglfs_viv/qeglfsvivintegration.cpp | 8 ++++++++ src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp | 10 +++++++++- src/plugins/platforms/eglfs/qeglfshooks.cpp | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/qeglfsvivintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/qeglfsvivintegration.cpp index eef4feb2c2..ca97f6c8f9 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/qeglfsvivintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/qeglfsvivintegration.cpp @@ -41,6 +41,10 @@ #include #include +#ifdef Q_OS_INTEGRITY +extern "C" void VivanteInit(void); +#endif + QT_BEGIN_NAMESPACE void QEglFSVivIntegration::platformInit() @@ -57,6 +61,10 @@ void QEglFSVivIntegration::platformInit() qputenv("FB_MULTI_BUFFER", "2"); } +#ifdef Q_OS_INTEGRITY + VivanteInit(); +#endif + mNativeDisplay = fbGetDisplayByIndex(framebufferIndex()); fbGetDisplayGeometry(mNativeDisplay, &width, &height); mScreenSize.setHeight(height); diff --git a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp index 84351dba5a..5cbc5dbdb0 100644 --- a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp @@ -120,11 +120,15 @@ static int framebuffer = -1; QByteArray QEGLDeviceIntegration::fbDeviceName() const { +#ifdef Q_OS_LINUX QByteArray fbDev = qgetenv("QT_QPA_EGLFS_FB"); if (fbDev.isEmpty()) fbDev = QByteArrayLiteral("/dev/fb0"); return fbDev; +#else + return QByteArray(); +#endif } int QEGLDeviceIntegration::framebufferIndex() const @@ -141,6 +145,7 @@ int QEGLDeviceIntegration::framebufferIndex() const void QEGLDeviceIntegration::platformInit() { +#ifdef Q_OS_LINUX QByteArray fbDev = fbDeviceName(); framebuffer = qt_safe_open(fbDev, O_RDONLY); @@ -153,12 +158,15 @@ void QEGLDeviceIntegration::platformInit() #ifdef FBIOBLANK ioctl(framebuffer, FBIOBLANK, VESA_NO_BLANKING); #endif +#endif } void QEGLDeviceIntegration::platformDestroy() { +#ifdef Q_OS_LINUX if (framebuffer != -1) close(framebuffer); +#endif } EGLNativeDisplayType QEGLDeviceIntegration::platformDisplay() const @@ -307,7 +315,7 @@ void QEGLDeviceIntegration::waitForVSync(QPlatformSurface *surface) const { Q_UNUSED(surface); -#if defined(FBIO_WAITFORVSYNC) +#if defined(Q_OS_LINUX) && defined(FBIO_WAITFORVSYNC) static const bool forceSync = qEnvironmentVariableIntValue("QT_QPA_EGLFS_FORCEVSYNC"); if (forceSync && framebuffer != -1) { int arg = 0; diff --git a/src/plugins/platforms/eglfs/qeglfshooks.cpp b/src/plugins/platforms/eglfs/qeglfshooks.cpp index 1cdbb1dd39..87285428df 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks.cpp @@ -66,7 +66,7 @@ private: Q_GLOBAL_STATIC(DeviceIntegration, deviceIntegration) -DeviceIntegration::DeviceIntegration() +DeviceIntegration::DeviceIntegration() : m_integration(0) { QStringList pluginKeys = QEGLDeviceIntegrationFactory::keys(); if (!pluginKeys.isEmpty()) { -- cgit v1.2.3