summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRolland Dudemaine <rolland@ghs.com>2016-03-11 15:05:56 +0100
committerRolland Dudemaine <rolland@ghs.com>2016-04-13 08:14:40 +0000
commit9b35b0e8dc6069aed563d0aca61c973eb307d772 (patch)
tree91424c7b5d705677945b7a2e408c979df389477d /src
parent2687eb5a8c1495413dabb38750f0b6e8d93771e2 (diff)
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 <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/qeglfsvivintegration.cpp8
-rw-r--r--src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp10
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks.cpp2
4 files changed, 22 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index ea5a8e9252..e4e7c6d1b5 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -47,6 +47,10 @@
#include <qpa/qplatformintegration.h>
#include <QtCore/qloggingcategory.h>
+#ifdef Q_OS_INTEGRITY
+#include <EGL/egl.h>
+#endif
+
#ifndef GL_FRAMEBUFFER_SRGB_CAPABLE_EXT
#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
#endif
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 <EGL/eglvivante.h>
#include <QDebug>
+#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()) {