diff options
6 files changed, 35 insertions, 5 deletions
diff --git a/config.tests/qpa/eglfs-viv/eglfs-viv.cpp b/config.tests/qpa/eglfs-viv/eglfs-viv.cpp index 4b08322d66..a41c482b67 100644 --- a/config.tests/qpa/eglfs-viv/eglfs-viv.cpp +++ b/config.tests/qpa/eglfs-viv/eglfs-viv.cpp @@ -43,6 +43,6 @@ int main(int, char **) { - fbGetDisplayByIndex(0); + fbGetDisplay(); return 0; } diff --git a/config.tests/qpa/eglfs-viv/eglfs-viv.pro b/config.tests/qpa/eglfs-viv/eglfs-viv.pro index 99776940ec..3b36dc533f 100644 --- a/config.tests/qpa/eglfs-viv/eglfs-viv.pro +++ b/config.tests/qpa/eglfs-viv/eglfs-viv.pro @@ -1,6 +1,16 @@ SOURCES = eglfs-viv.cpp -DEFINES += LINUX=1 EGL_API_FB=1 - +integrity { + DEFINES += EGL_API_FB=1 +} else { + DEFINES += LINUX=1 EGL_API_FB=1 +} CONFIG -= qt LIBS += -lEGL -lGLESv2 -lGAL + +for(p, QMAKE_LIBDIR_OPENGL_ES2) { + exists($$p):LIBS += -L$$p +} + +!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL +!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL 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()) { |