eglfs: Pluginize RPi, iMX6 and Mali backends

eglfs does not depend on the device makespecs anymore when it comes to these device
integration backends (hooks). Instead, backends are autodetected by configure.

The name of the preferred plugin is still set in the device makespecs. This
is optional. When not set and there is more than one plugin present in the system,
the environment variable QT_QPA_EGLFS_INTEGRATION will have to be set at runtime.
In the absence of that, the order is undefined.

Change-Id: Ie1ced2c9aa1beff2adb13b4fdea7c499cb5a6aab
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
This commit is contained in:
Laszlo Agocs 2015-03-02 16:09:22 +01:00
parent c6045db4a6
commit d04c3d2079
29 changed files with 607 additions and 94 deletions

View File

@ -0,0 +1,45 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <bcm_host.h>
int main(int, char **)
{
EGLDisplay dpy = 0;
EGLContext ctx = 0;
eglDestroyContext(dpy, ctx);
vc_dispmanx_display_open(0);
return 0;
}

View File

@ -0,0 +1,9 @@
SOURCES = eglfs-brcm.cpp
CONFIG -= qt
INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include \
$$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads \
$$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
LIBS += -L$$[QT_SYSROOT]/opt/vc/lib -lEGL -lGLESv2 -lbcm_host

View File

@ -0,0 +1,45 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <EGL/fbdev_window.h>
#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(int, char **)
{
EGLDisplay dpy = 0;
EGLContext ctx = 0;
fbdev_window *w = 0;
eglDestroyContext(dpy, ctx);
return 0;
}

View File

@ -0,0 +1,5 @@
SOURCES = eglfs-mali.cpp
CONFIG -= qt
LIBS += -lEGL -lGLESv2

View File

@ -0,0 +1,42 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <EGL/egl.h>
#include <EGL/eglvivante.h>
#include <GLES2/gl2.h>
int main(int, char **)
{
fbGetDisplayByIndex(0);
return 0;
}

View File

@ -0,0 +1,6 @@
SOURCES = eglfs-viv.cpp
DEFINES += LINUX=1 EGL_API_FB=1
CONFIG -= qt
LIBS += -lEGL -lGLESv2 -lGAL

32
configure vendored
View File

@ -5553,6 +5553,22 @@ fi
if [ "$CFG_EGLFS" != "no" ]; then
if [ "$XPLATFORM_QNX" = "no" ] && [ "$CFG_OPENGL" != "no" ]; then
CFG_EGLFS="$CFG_EGL"
# Detect eglfs backends.
if compileTest qpa/eglfs-brcm "eglfs-brcm"; then
CFG_EGLFS_BRCM=yes
else
CFG_EGLFS_BRCM=no
fi
if compileTest qpa/eglfs-mali "eglfs-mali"; then
CFG_EGLFS_MALI=yes
else
CFG_EGLFS_MALI=no
fi
if compileTest qpa/eglfs-viv "eglfs-viv"; then
CFG_EGLFS_VIV=yes
else
CFG_EGLFS_VIV=no
fi
else
CFG_EGLFS="no"
fi
@ -5964,6 +5980,16 @@ if [ "$CFG_EGLFS" = "yes" ]; then
else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGLFS"
fi
# eglfs backends
if [ "$CFG_EGLFS_BRCM" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_brcm"
fi
if [ "$CFG_EGLFS_MALI" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_mali"
fi
if [ "$CFG_EGLFS_VIV" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_viv"
fi
# enable openvg
if [ "$CFG_OPENVG" = "no" ]; then
@ -6998,7 +7024,11 @@ report_support " PulseAudio ............." "$CFG_PULSEAUDIO"
report_support " QPA backends:"
report_support " DirectFB ............." "$CFG_DIRECTFB"
report_support " EGLFS ................" "$CFG_EGLFS"
report_support " KMS .................." "$CFG_KMS"
report_support " EGLFS i.MX6....... ." "$CFG_EGLFS_VIV"
report_support " EGLFS KMS .........." "$CFG_KMS"
report_support " EGLFS Mali ........." "$CFG_EGLFS_MALI"
report_support " EGLFS Raspberry Pi ." "$CFG_EGLFS_BRCM"
report_support " EGLFS X11 .........." "$CFG_EGL_X"
report_support " LinuxFB .............." "$CFG_LINUXFB"
report_support " XCB .................." "$CFG_XCB" system "system library" qt "bundled copy"
if [ "$CFG_XCB" != "no" ]; then

View File

@ -18,7 +18,6 @@
# -prefix /home/abc/project/sysbase/qt_install
include(../common/linux_device_pre.conf)
EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_hix5hd2.cpp
QMAKE_INCDIR += /usr/arm-linux-gnueabihf/include
QMAKE_LIBDIR += /usr/arm-linux-gnueabihf/lib
@ -39,6 +38,9 @@ DISTRO_OPTS += hard-float
QMAKE_CFLAGS +=-march=armv7-a -mcpu=cortex-a9 -mfpu=vfpv3-d16
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS
# Preferred eglfs backend
EGLFS_DEVICE_INTEGRATION = eglfs_mali
include(../common/linux_arm_device_post.conf)
load(qt_config)

View File

@ -4,8 +4,6 @@
include(../common/linux_device_pre.conf)
EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_imx6.cpp
QMAKE_INCDIR += $$[QT_SYSROOT]/usr/include
QMAKE_LIBDIR += $$[QT_SYSROOT]/usr/lib
@ -21,6 +19,9 @@ QMAKE_CXXFLAGS += $$IMX6_CFLAGS
DISTRO_OPTS += hard-float
# Preferred eglfs backend
EGLFS_DEVICE_INTEGRATION = eglfs_viv
include(../common/linux_arm_device_post.conf)
load(qt_config)

View File

@ -36,8 +36,8 @@ QMAKE_CFLAGS += \
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_pi.cpp
EGLFS_PLATFORM_HOOKS_LIBS = -lbcm_host
# Preferred eglfs backend
EGLFS_DEVICE_INTEGRATION = eglfs_brcm
include(../common/linux_arm_device_post.conf)

View File

@ -18,8 +18,8 @@ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
DISTRO_OPTS += hard-float
EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/../linux-rasp-pi-g++/qeglfshooks_pi.cpp
EGLFS_PLATFORM_HOOKS_LIBS = -lbcm_host
# Preferred eglfs backend
EGLFS_DEVICE_INTEGRATION = eglfs_brcm
include(../common/linux_arm_device_post.conf)

View File

@ -2,3 +2,6 @@ TEMPLATE = subdirs
contains(QT_CONFIG, egl_x11): SUBDIRS += eglfs_x11
contains(QT_CONFIG, kms): SUBDIRS += eglfs_kms
contains(QT_CONFIG, eglfs_brcm): SUBDIRS += eglfs_brcm
contains(QT_CONFIG, eglfs_mali): SUBDIRS += eglfs_mali
contains(QT_CONFIG, eglfs_viv): SUBDIRS += eglfs_viv

View File

@ -0,0 +1,3 @@
{
"Keys": [ "eglfs_brcm" ]
}

View File

@ -0,0 +1,20 @@
TARGET = qeglfs-brcm-integration
PLUGIN_TYPE = egldeviceintegrations
PLUGIN_CLASS_NAME = QEglFSBrcmIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private eglfs_device_lib-private
INCLUDEPATH += $$PWD/../..
CONFIG += egl
LIBS += -lbcm_host
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
SOURCES += $$PWD/qeglfsbrcmmain.cpp \
$$PWD/qeglfsbrcmintegration.cpp
HEADERS += $$PWD/qeglfsbrcmintegration.h
OTHER_FILES += $$PWD/eglfs_brcm.json

View File

@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the qmake spec of the Qt Toolkit.
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@ -31,13 +31,7 @@
**
****************************************************************************/
#include "qeglfshooks.h"
#include <QtDebug>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
#include "qeglfsbrcmintegration.h"
#include <bcm_host.h>
QT_BEGIN_NAMESPACE
@ -88,54 +82,41 @@ static void destroyDispmanxLayer(EGLNativeWindowType window)
delete eglWindow;
}
class QEglFSPiHooks : public QEglFSHooks
{
public:
virtual void platformInit();
virtual void platformDestroy();
virtual EGLNativeDisplayType platformDisplay() const;
virtual QSize screenSize() const;
virtual EGLNativeWindowType createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format);
virtual void destroyNativeWindow(EGLNativeWindowType window);
virtual bool hasCapability(QPlatformIntegration::Capability cap) const;
};
void QEglFSPiHooks::platformInit()
void QEglFSBrcmIntegration::platformInit()
{
bcm_host_init();
}
EGLNativeDisplayType QEglFSPiHooks::platformDisplay() const
EGLNativeDisplayType QEglFSBrcmIntegration::platformDisplay() const
{
dispman_display = vc_dispmanx_display_open(0/* LCD */);
return EGL_DEFAULT_DISPLAY;
}
void QEglFSPiHooks::platformDestroy()
void QEglFSBrcmIntegration::platformDestroy()
{
vc_dispmanx_display_close(dispman_display);
}
QSize QEglFSPiHooks::screenSize() const
QSize QEglFSBrcmIntegration::screenSize() const
{
uint32_t width, height;
graphics_get_display_size(0 /* LCD */, &width, &height);
return QSize(width, height);
}
EGLNativeWindowType QEglFSPiHooks::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format)
EGLNativeWindowType QEglFSBrcmIntegration::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format)
{
Q_UNUSED(window)
return createDispmanxLayer(QPoint(0, 0), size, 1, format.hasAlpha() ? DISPMANX_FLAGS_ALPHA_FROM_SOURCE : DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS);
}
void QEglFSPiHooks::destroyNativeWindow(EGLNativeWindowType window)
void QEglFSBrcmIntegration::destroyNativeWindow(EGLNativeWindowType window)
{
destroyDispmanxLayer(window);
}
bool QEglFSPiHooks::hasCapability(QPlatformIntegration::Capability cap) const
bool QEglFSBrcmIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
switch (cap) {
case QPlatformIntegration::ThreadedPixmaps:
@ -148,7 +129,4 @@ bool QEglFSPiHooks::hasCapability(QPlatformIntegration::Capability cap) const
}
}
QEglFSPiHooks eglFSPiHooks;
QEglFSHooks *platformHooks = &eglFSPiHooks;
QT_END_NAMESPACE

View File

@ -0,0 +1,55 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QEGLFSBRCMINTEGRATION_H
#define QEGLFSBRCMINTEGRATION_H
#include "qeglfsdeviceintegration.h"
QT_BEGIN_NAMESPACE
class QEglFSBrcmIntegration : public QEGLDeviceIntegration
{
public:
void platformInit() Q_DECL_OVERRIDE;
void platformDestroy() Q_DECL_OVERRIDE;
EGLNativeDisplayType platformDisplay() const Q_DECL_OVERRIDE;
QSize screenSize() const Q_DECL_OVERRIDE;
EGLNativeWindowType createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format) Q_DECL_OVERRIDE;
void destroyNativeWindow(EGLNativeWindowType window) Q_DECL_OVERRIDE;
bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
};
QT_END_NAMESPACE
#endif

View File

@ -0,0 +1,50 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qeglfsdeviceintegration.h"
#include "qeglfsbrcmintegration.h"
QT_BEGIN_NAMESPACE
class QEglFSBrcmIntegrationPlugin : public QEGLDeviceIntegrationPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QEGLDeviceIntegrationFactoryInterface_iid FILE "eglfs_brcm.json")
public:
QEGLDeviceIntegration *create() Q_DECL_OVERRIDE { return new QEglFSBrcmIntegration; }
};
QT_END_NAMESPACE
#include "qeglfsbrcmmain.moc"

View File

@ -1,8 +1,7 @@
TARGET = qeglfs-kms-integration
PLUGIN_CLASS_NAME=QEglFSKmsIntegrationPlugin
PLUGIN_TYPE=egldeviceintegrations
PLUGIN_TYPE = egldeviceintegrations
PLUGIN_CLASS_NAME = QEglFSKmsIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private eglfs_device_lib-private

View File

@ -0,0 +1,3 @@
{
"Keys": [ "eglfs_mali" ]
}

View File

@ -0,0 +1,18 @@
TARGET = qeglfs-mali-integration
PLUGIN_TYPE = egldeviceintegrations
PLUGIN_CLASS_NAME = QEglFSMaliIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private eglfs_device_lib-private
INCLUDEPATH += $$PWD/../..
CONFIG += egl
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
SOURCES += $$PWD/qeglfsmalimain.cpp \
$$PWD/qeglfsmaliintegration.cpp
HEADERS += $$PWD/qeglfsmaliintegration.h
OTHER_FILES += $$PWD/eglfs_mali.json

View File

@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the qmake spec of the Qt Toolkit.
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@ -31,7 +31,7 @@
**
****************************************************************************/
#include "qeglfshooks.h"
#include "qeglfsmaliintegration.h"
#include <EGL/fbdev_window.h>
#include <unistd.h>
@ -43,18 +43,11 @@
QT_BEGIN_NAMESPACE
class QEglFSHiX5Hd2Hooks : public QEglFSHooks
void QEglFSMaliIntegration::platformInit()
{
private:
void fbInit();
public:
void platformInit() Q_DECL_OVERRIDE;
EGLNativeWindowType createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format) Q_DECL_OVERRIDE;
void destroyNativeWindow(EGLNativeWindowType window) Q_DECL_OVERRIDE;
};
// Keep the non-overridden base class functions based on fb0 working.
QEGLDeviceIntegration::platformInit();
void QEglFSHiX5Hd2Hooks::fbInit()
{
int fd = qt_safe_open("/dev/fb0", O_RDWR, 0);
if (fd == -1)
qWarning("Failed to open fb to detect screen resolution!");
@ -79,17 +72,13 @@ void QEglFSHiX5Hd2Hooks::fbInit()
qErrnoWarning(errno, "Unable to set double buffer mode!");
qt_safe_close(fd);
return;
}
void QEglFSHiX5Hd2Hooks::platformInit()
EGLNativeWindowType QEglFSMaliIntegration::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format)
{
QEglFSHooks::platformInit();
fbInit();
}
Q_UNUSED(window);
Q_UNUSED(format);
EGLNativeWindowType QEglFSHiX5Hd2Hooks::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format)
{
fbdev_window *fbwin = reinterpret_cast<fbdev_window *>(malloc(sizeof(fbdev_window)));
if (NULL == fbwin)
return 0;
@ -99,12 +88,9 @@ EGLNativeWindowType QEglFSHiX5Hd2Hooks::createNativeWindow(QPlatformWindow *wind
return (EGLNativeWindowType)fbwin;
}
void QEglFSHiX5Hd2Hooks::destroyNativeWindow(EGLNativeWindowType window)
void QEglFSMaliIntegration::destroyNativeWindow(EGLNativeWindowType window)
{
free(window);
}
QEglFSHiX5Hd2Hooks eglFSHiX5Hd2Hooks;
QEglFSHooks *platformHooks = &eglFSHiX5Hd2Hooks;
QT_END_NAMESPACE

View File

@ -0,0 +1,51 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QEGLFSMALIINTEGRATION_H
#define QEGLFSMALIINTEGRATION_H
#include "qeglfsdeviceintegration.h"
QT_BEGIN_NAMESPACE
class QEglFSMaliIntegration : public QEGLDeviceIntegration
{
public:
void platformInit() Q_DECL_OVERRIDE;
EGLNativeWindowType createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format) Q_DECL_OVERRIDE;
void destroyNativeWindow(EGLNativeWindowType window) Q_DECL_OVERRIDE;
};
QT_END_NAMESPACE
#endif

View File

@ -0,0 +1,50 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qeglfsdeviceintegration.h"
#include "qeglfsmaliintegration.h"
QT_BEGIN_NAMESPACE
class QEglFSMaliIntegrationPlugin : public QEGLDeviceIntegrationPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QEGLDeviceIntegrationFactoryInterface_iid FILE "eglfs_mali.json")
public:
QEGLDeviceIntegration *create() Q_DECL_OVERRIDE { return new QEglFSMaliIntegration; }
};
QT_END_NAMESPACE
#include "qeglfsmalimain.moc"

View File

@ -0,0 +1,3 @@
{
"Keys": [ "eglfs_viv" ]
}

View File

@ -0,0 +1,20 @@
TARGET = qeglfs-viv-integration
PLUGIN_TYPE = egldeviceintegrations
PLUGIN_CLASS_NAME = QEglFSVivIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private eglfs_device_lib-private
INCLUDEPATH += $$PWD/../..
CONFIG += egl
DEFINES += LINUX=1 EGL_API_FB=1
LIBS += -lGAL
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
SOURCES += $$PWD/qeglfsvivmain.cpp \
$$PWD/qeglfsvivintegration.cpp
HEADERS += $$PWD/qeglfsvivintegration.h
OTHER_FILES += $$PWD/eglfs_viv.json

View File

@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the qmake spec of the Qt Toolkit.
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@ -31,35 +31,22 @@
**
****************************************************************************/
#include "qeglfshooks.h"
#include "qeglfsvivintegration.h"
#include <EGL/eglvivante.h>
#include <QDebug>
QT_BEGIN_NAMESPACE
class QEglFSImx6Hooks : public QEglFSHooks
void QEglFSVivIntegration::platformInit()
{
public:
QEglFSImx6Hooks();
virtual QSize screenSize() const;
virtual EGLNativeWindowType createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format);
virtual void destroyNativeWindow(EGLNativeWindowType window);
virtual EGLNativeDisplayType platformDisplay() const;
QEGLDeviceIntegration::platformInit();
private:
QSize mScreenSize;
EGLNativeDisplayType mNativeDisplay;
};
QEglFSImx6Hooks::QEglFSImx6Hooks()
{
int width, height;
bool multiBufferNotEnabledYet = qEnvironmentVariableIsEmpty("FB_MULTI_BUFFER");
bool multiBuffer = qEnvironmentVariableIsEmpty("QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER");
if (multiBufferNotEnabledYet && multiBuffer) {
qWarning() << "QEglFSImx6Hooks will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.\n"
qWarning() << "QEglFSVivIntegration will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.\n"
<< "If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1";
qputenv("FB_MULTI_BUFFER", "2");
}
@ -70,17 +57,17 @@ QEglFSImx6Hooks::QEglFSImx6Hooks()
mScreenSize.setWidth(width);
}
QSize QEglFSImx6Hooks::screenSize() const
QSize QEglFSVivIntegration::screenSize() const
{
return mScreenSize;
}
EGLNativeDisplayType QEglFSImx6Hooks::platformDisplay() const
EGLNativeDisplayType QEglFSVivIntegration::platformDisplay() const
{
return mNativeDisplay;
}
EGLNativeWindowType QEglFSImx6Hooks::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format)
EGLNativeWindowType QEglFSVivIntegration::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format)
{
Q_UNUSED(window)
Q_UNUSED(format)
@ -89,13 +76,9 @@ EGLNativeWindowType QEglFSImx6Hooks::createNativeWindow(QPlatformWindow *window,
return eglWindow;
}
void QEglFSImx6Hooks::destroyNativeWindow(EGLNativeWindowType window)
void QEglFSVivIntegration::destroyNativeWindow(EGLNativeWindowType window)
{
fbDestroyWindow(window);
}
QEglFSImx6Hooks eglFSImx6Hooks;
QEglFSHooks *platformHooks = &eglFSImx6Hooks;
QT_END_NAMESPACE

View File

@ -0,0 +1,57 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QEGLFSVIVINTEGRATION_H
#define QEGLFSVIVINTEGRATION_H
#include "qeglfsdeviceintegration.h"
QT_BEGIN_NAMESPACE
class QEglFSVivIntegration : public QEGLDeviceIntegration
{
public:
void platformInit() Q_DECL_OVERRIDE;
QSize screenSize() const Q_DECL_OVERRIDE;
EGLNativeWindowType createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format) Q_DECL_OVERRIDE;
void destroyNativeWindow(EGLNativeWindowType window) Q_DECL_OVERRIDE;
EGLNativeDisplayType platformDisplay() const Q_DECL_OVERRIDE;
private:
QSize mScreenSize;
EGLNativeDisplayType mNativeDisplay;
};
QT_END_NAMESPACE
#endif

View File

@ -0,0 +1,50 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qeglfsdeviceintegration.h"
#include "qeglfsvivintegration.h"
QT_BEGIN_NAMESPACE
class QEglFSVivIntegrationPlugin : public QEGLDeviceIntegrationPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QEGLDeviceIntegrationFactoryInterface_iid FILE "eglfs_viv.json")
public:
QEGLDeviceIntegration *create() Q_DECL_OVERRIDE { return new QEglFSVivIntegration; }
};
QT_END_NAMESPACE
#include "qeglfsvivmain.moc"

View File

@ -1,8 +1,7 @@
TARGET = qeglfs-x11-integration
PLUGIN_CLASS_NAME=QEglFSX11IntegrationPlugin
PLUGIN_TYPE=egldeviceintegrations
PLUGIN_TYPE = egldeviceintegrations
PLUGIN_CLASS_NAME = QEglFSX11IntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private eglfs_device_lib-private