diff options
author | Donald Carr <donald.carr@nokia.com> | 2011-09-29 22:46:32 +0000 |
---|---|---|
committer | Donald Carr <donald.carr@nokia.com> | 2011-09-29 22:50:59 +0000 |
commit | 4973452ca330ef09bf050393e43e25c8a25998f5 (patch) | |
tree | 2316d68d6cae736eaba2a68914f9d94ab53eb5e8 /simpleglscreen.cpp | |
parent | 77704a984b6819230d98445e0117fd24633624f0 (diff) |
Diffstat (limited to 'simpleglscreen.cpp')
-rw-r--r-- | simpleglscreen.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/simpleglscreen.cpp b/simpleglscreen.cpp index a10a619..8384118 100644 --- a/simpleglscreen.cpp +++ b/simpleglscreen.cpp @@ -52,6 +52,10 @@ extern "C" { }; #endif +#ifdef RASP_PI +#include "interface/vchiq_arm/vchiq_if.h" +#endif + QT_BEGIN_NAMESPACE static inline bool setIntOption(const QStringList &arguments, const QString &variable, int *value) @@ -123,6 +127,23 @@ static QImage::Format egl_config_to_image_format(QEglContext *context) bool SimpleGLScreen::connect(const QString &displaySpec) { +#ifdef RASP_PI + VCHI_INSTANCE_T vchiq_instance; + VCHI_CONNECTION_T *vchi_connection; + + vcos_init(); + if (vchi_initialise(&vchiq_instance) != VCHIQ_SUCCESS) { + printf("* failed to open vchiq instance\n"); + return -1; + } + //create a vchi connection + if ( vchi_connect( NULL, 0, vchiq_instance ) != 0) { + printf( "VCHI connection failed\n" ); + return -1; + } + vc_vchi_dispmanx_init( vchiq_instance, &vchi_connection, 1 ); +#endif + const QStringList displayArgs = displaySpec.split(QLatin1Char(':'), QString::SkipEmptyParts); // Initialize EGL and choose a default EGLConfig. |