From c15917447a50602975e906b991b1de4aeac80a08 Mon Sep 17 00:00:00 2001 From: ChukRhodes Date: Wed, 6 Jan 2016 22:20:29 -0500 Subject: [PATCH] R.Pi2 Support Allows QGC to run on Raspberry Pi 2 with direct framebuffer (X/startx not needed). Memory split seems to need 128 for GPU. Qt5 needs to be configured with "-opengl es2 -qpa eglfs -device linux-rasp-pi2-g++". --- QGCCommon.pri | 4 ++++ QGCSetup.pri | 17 ++++++++++++----- .../gstqtvideosink/utils/glutils.h | 10 +++++++++- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/QGCCommon.pri b/QGCCommon.pri index f4fde658f..37d65d7e0 100644 --- a/QGCCommon.pri +++ b/QGCCommon.pri @@ -31,6 +31,10 @@ linux { message("Linux build") CONFIG += LinuxBuild DEFINES += __STDC_LIMIT_MACROS + } else : linux-rasp-pi2-g++ { + message("Linux R-Pi2 build") + CONFIG += LinuxBuild + DEFINES += __STDC_LIMIT_MACROS __rasp_pi2__ } else : android-g++ { message("Android build") CONFIG += AndroidBuild MobileBuild diff --git a/QGCSetup.pri b/QGCSetup.pri index 3afde8042..69c80def0 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -103,9 +103,6 @@ LinuxBuild { # QT_INSTALL_LIBS QT_LIB_LIST = \ - libicudata.so.54 \ - libicui18n.so.54 \ - libicuuc.so.54 \ libQt5Core.so.5 \ libQt5DBus.so.5 \ libQt5Gui.so.5 \ @@ -123,14 +120,24 @@ LinuxBuild { libQt5Widgets.so.5 \ libQt5XcbQpa.so.5 + !contains(DEFINES, __rasp_pi2__) { + QT_LIB_LIST += \ + libicudata.so.54 \ + libicui18n.so.54 \ + libicuuc.so.54 + } + for(QT_LIB, QT_LIB_LIST) { QMAKE_POST_LINK += && $$QMAKE_COPY --dereference $$[QT_INSTALL_LIBS]/$$QT_LIB $$DESTDIR/libs } # QT_INSTALL_PLUGINS QT_PLUGIN_LIST = \ - platforms \ - xcbglintegrations + platforms + + !contains(DEFINES, __rasp_pi2__) { + QT_PLUGIN_LIST += xcbglintegrations + } for(QT_PLUGIN, QT_PLUGIN_LIST) { QMAKE_POST_LINK += && $$QMAKE_COPY --dereference --recursive $$[QT_INSTALL_PLUGINS]/$$QT_PLUGIN $$DESTDIR/libs diff --git a/src/VideoStreaming/gstqtvideosink/utils/glutils.h b/src/VideoStreaming/gstqtvideosink/utils/glutils.h index 02fa0985c..41fe35d8c 100644 --- a/src/VideoStreaming/gstqtvideosink/utils/glutils.h +++ b/src/VideoStreaming/gstqtvideosink/utils/glutils.h @@ -34,7 +34,15 @@ This file is part of the QGROUNDCONTROL project #include #define getQOpenGLFunctions() QOpenGLContext::currentContext()->functions() #define QOpenGLFunctionsDef QOpenGLFunctions -#else +#endif + +#ifdef __rasp_pi2__ +#include +#define getQOpenGLFunctions() QOpenGLContext::currentContext()->versionFunctions() +#define QOpenGLFunctionsDef QOpenGLFunctions_ES2 +#endif + +#ifndef QOpenGLFunctionsDef #include #define getQOpenGLFunctions() QOpenGLContext::currentContext()->versionFunctions() #define QOpenGLFunctionsDef QOpenGLFunctions_2_0 -- 2.22.0