Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/hwcomposer/hwcomposer.pro b/hwcomposer/hwcomposer.pro
- index 4ca6376..6fd2d0a 100644
- --- a/hwcomposer/hwcomposer.pro
- +++ b/hwcomposer/hwcomposer.pro
- @@ -18,8 +18,8 @@ HEADERS += hwcomposer_screeninfo.h
- SOURCES += hwcomposer_backend.cpp
- HEADERS += hwcomposer_backend.h
- -SOURCES += hwcomposer_backend_v0.cpp
- -HEADERS += hwcomposer_backend_v0.h
- +#SOURCES += hwcomposer_backend_v0.cpp
- +#HEADERS += hwcomposer_backend_v0.h
- SOURCES += hwcomposer_backend_v10.cpp
- HEADERS += hwcomposer_backend_v10.h
- @@ -28,7 +28,7 @@ SOURCES += hwcomposer_backend_v11.cpp
- HEADERS += hwcomposer_backend_v11.h
- -QT += core-private compositor-private gui-private platformsupport-private
- +QT += core-private compositor-private gui-private platformsupport-private dbus
- DEFINES += QEGL_EXTRA_DEBUG
- CONFIG += egl qpa/genericunixfontdatabase
- @@ -57,14 +57,12 @@ SOURCES += $$PWD/qeglfsintegration.cpp \
- $$PWD/qeglfswindow.cpp \
- $$PWD/qeglfsbackingstore.cpp \
- $$PWD/qeglfsscreen.cpp \
- - $$PWD/qeglfscontext.cpp \
- - $$PWD/qeglfspageflipper.cpp
- + $$PWD/qeglfscontext.cpp
- HEADERS += $$PWD/qeglfsintegration.h \
- $$PWD/qeglfswindow.h \
- $$PWD/qeglfsbackingstore.h \
- $$PWD/qeglfsscreen.h \
- - $$PWD/qeglfscontext.h \
- - $$PWD/qeglfspageflipper.h
- + $$PWD/qeglfscontext.h
- QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
- diff --git a/hwcomposer/hwcomposer_backend.cpp b/hwcomposer/hwcomposer_backend.cpp
- index af684a6..7bdad35 100644
- --- a/hwcomposer/hwcomposer_backend.cpp
- +++ b/hwcomposer/hwcomposer_backend.cpp
- @@ -40,7 +40,7 @@
- ****************************************************************************/
- #include "hwcomposer_backend.h"
- -#include "hwcomposer_backend_v0.h"
- +//#include "hwcomposer_backend_v0.h"
- #include "hwcomposer_backend_v10.h"
- #include "hwcomposer_backend_v11.h"
- @@ -100,19 +100,19 @@ HwComposerBackend::create()
- // Special-case for old hw adaptations that have the version encoded in
- // legacy format, we have to check hwc_device->version directly, because
- // the constants are actually encoded in the old format
- - if ((hwc_device->version == HWC_DEVICE_API_VERSION_0_1) ||
- - (hwc_device->version == HWC_DEVICE_API_VERSION_0_2) ||
- - (hwc_device->version == HWC_DEVICE_API_VERSION_0_3)) {
- - return new HwComposerBackend_v0(hwc_module, hwc_device);
- - }
- +// if ((hwc_device->version == HWC_DEVICE_API_VERSION_0_1) ||
- +// (hwc_device->version == HWC_DEVICE_API_VERSION_0_2) ||
- +// (hwc_device->version == HWC_DEVICE_API_VERSION_0_3)) {
- +// return new HwComposerBackend_v0(hwc_module, hwc_device);
- +// }
- // Determine which backend we use based on the supported module API version
- switch (version) {
- - case HWC_DEVICE_API_VERSION_0_1:
- - case HWC_DEVICE_API_VERSION_0_2:
- - case HWC_DEVICE_API_VERSION_0_3:
- - return new HwComposerBackend_v0(hwc_module, hwc_device);
- - break;
- +// case HWC_DEVICE_API_VERSION_0_1:
- +// case HWC_DEVICE_API_VERSION_0_2:
- +// case HWC_DEVICE_API_VERSION_0_3:
- +// return new HwComposerBackend_v0(hwc_module, hwc_device);
- +// break;
- #ifdef HWC_DEVICE_API_VERSION_1_0
- case HWC_DEVICE_API_VERSION_1_0:
- return new HwComposerBackend_v10(hwc_module, hwc_device);
- diff --git a/hwcomposer/hwcomposer_backend_v0.cpp b/hwcomposer/hwcomposer_backend_v0.cpp
- index 9a8f9a5..e91080c 100644
- --- a/hwcomposer/hwcomposer_backend_v0.cpp
- +++ b/hwcomposer/hwcomposer_backend_v0.cpp
- @@ -39,7 +39,7 @@
- **
- ****************************************************************************/
- -#include "hwcomposer_backend_v0.h"
- +//#include "hwcomposer_backend_v0.h"
- HwComposerBackend_v0::HwComposerBackend_v0(hw_module_t *hwc_module, hw_device_t *hw_device)
- diff --git a/hwcomposer/main.cpp b/hwcomposer/main.cpp
- index 666dd31..de5192e 100644
- --- a/hwcomposer/main.cpp
- +++ b/hwcomposer/main.cpp
- @@ -47,20 +47,16 @@ QT_BEGIN_NAMESPACE
- class QEglFSIntegrationPlugin : public QPlatformIntegrationPlugin
- {
- Q_OBJECT
- -#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
- - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.1" FILE "hwcomposer.json")
- -#else
- - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2" FILE "hwcomposer.json")
- -#endif
- + Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "hwcomposer.json");
- public:
- - QPlatformIntegration *create(const QString&, const QStringList&);
- + QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
- };
- QPlatformIntegration* QEglFSIntegrationPlugin::create(const QString& system, const QStringList& paramList)
- {
- Q_UNUSED(paramList);
- - if (system.toLower() == "hwcomposer")
- - return new QEglFSIntegration;
- + if (!system.compare(QLatin1String("hwcomposer"), Qt::CaseInsensitive))
- + return new QEglFSIntegration();
- return 0;
- }
- diff --git a/hwcomposer/qeglfscontext.cpp b/hwcomposer/qeglfscontext.cpp
- index d15581b..3e30e08 100644
- --- a/hwcomposer/qeglfscontext.cpp
- +++ b/hwcomposer/qeglfscontext.cpp
- @@ -42,23 +42,50 @@
- #include "qeglfscontext.h"
- #include "qeglfswindow.h"
- #include "qeglfsintegration.h"
- -#include "qeglfspageflipper.h"
- +//#include "qeglfspageflipper.h"
- #include <QtPlatformSupport/private/qeglpbuffer_p.h>
- #include <QtGui/QSurface>
- #include <QtDebug>
- QT_BEGIN_NAMESPACE
- -QEglFSContext::QEglFSContext(HwComposerContext *hwc, QEglFSPageFlipper *pageFlipper, const QSurfaceFormat &format, QPlatformOpenGLContext *share,
- - EGLDisplay display, EGLenum eglApi)
- - : QEGLPlatformContext(hwc->surfaceFormatFor(format), share, display, QEglFSIntegration::chooseConfig(display, hwc->surfaceFormatFor(format)), eglApi),
- - m_pageFlipper(pageFlipper), m_hwc(hwc)
- +QEglFSContext::QEglFSContext(
- + HwComposerContext *hwc
- + , const QSurfaceFormat &format
- + , QPlatformOpenGLContext *share
- + , EGLDisplay display
- +#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
- + , EGLenum eglApi
- +#endif
- + )
- + : QEGLPlatformContext(
- + hwc->surfaceFormatFor(format)
- + , share
- + , display
- + , &(m_config = QEglFSIntegration::chooseConfig(display, hwc->surfaceFormatFor(format)))
- +#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
- + , eglApi
- +#endif
- + ),
- + m_hwc(hwc), m_swapIntervalConfigured(false)
- {
- }
- bool QEglFSContext::makeCurrent(QPlatformSurface *surface)
- {
- - return QEGLPlatformContext::makeCurrent(surface);
- + bool current = QEGLPlatformContext::makeCurrent(surface);
- + if (current && !m_swapIntervalConfigured) {
- + m_swapIntervalConfigured = true;
- + int swapInterval = 1;
- + QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL");
- + if (!swapIntervalString.isEmpty()) {
- + bool ok;
- + swapInterval = swapIntervalString.toInt(&ok);
- + if (!ok)
- + swapInterval = 1;
- + }
- + eglSwapInterval(eglDisplay(), swapInterval);
- + }
- }
- EGLSurface QEglFSContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
- diff --git a/hwcomposer/qeglfscontext.h b/hwcomposer/qeglfscontext.h
- index 2864252..c5da9fc 100644
- --- a/hwcomposer/qeglfscontext.h
- +++ b/hwcomposer/qeglfscontext.h
- @@ -44,7 +44,6 @@
- #include <QtPlatformSupport/private/qeglconvenience_p.h>
- #include <QtPlatformSupport/private/qeglplatformcontext_p.h>
- -#include "qeglfspageflipper.h"
- #include "hwcomposer_context.h"
- @@ -53,15 +52,20 @@ QT_BEGIN_NAMESPACE
- class QEglFSContext : public QEGLPlatformContext
- {
- public:
- - QEglFSContext(HwComposerContext *hwc, QEglFSPageFlipper *pageFlipper,
- - const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display,
- - EGLenum eglApi = EGL_OPENGL_ES_API);
- + QEglFSContext(HwComposerContext *hwc,
- + const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display
- +#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
- + , EGLenum eglApi = EGL_OPENGL_ES_API);
- +#else
- + );
- +#endif
- bool makeCurrent(QPlatformSurface *surface);
- EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface);
- void swapBuffers(QPlatformSurface *surface);
- private:
- HwComposerContext *m_hwc;
- - QEglFSPageFlipper *m_pageFlipper;
- + EGLConfig m_config;
- + bool m_swapIntervalConfigured;
- };
- QT_END_NAMESPACE
- diff --git a/hwcomposer/qeglfsintegration.cpp b/hwcomposer/qeglfsintegration.cpp
- index 9fe2bf2..a05769d 100644
- --- a/hwcomposer/qeglfsintegration.cpp
- +++ b/hwcomposer/qeglfsintegration.cpp
- @@ -63,7 +63,6 @@
- #include <qpa/qplatforminputcontextfactory_p.h>
- #include "qeglfscontext.h"
- -#include "qeglfspageflipper.h"
- #include <EGL/egl.h>
- @@ -107,16 +106,6 @@ QEglFSIntegration::QEglFSIntegration()
- qFatal("EGL error");
- }
- - int swapInterval = 1;
- - QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL");
- - if (!swapIntervalString.isEmpty()) {
- - bool ok;
- - swapInterval = swapIntervalString.toInt(&ok);
- - if (!ok)
- - swapInterval = 1;
- - }
- - eglSwapInterval(mDisplay, swapInterval);
- -
- mScreen = new QEglFSScreen(mHwc, mDisplay);
- screenAdded(mScreen);
- @@ -160,7 +149,7 @@ QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *wi
- QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
- {
- - return new QEglFSContext(mHwc, static_cast<QEglFSPageFlipper *>(mScreen->pageFlipper()), mHwc->surfaceFormatFor(context->format()), context->shareHandle(), mDisplay);
- + return new QEglFSContext(mHwc, mHwc->surfaceFormatFor(context->format()), context->shareHandle(), mDisplay);
- }
- QPlatformOffscreenSurface *QEglFSIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
- diff --git a/hwcomposer/qeglfsscreen.cpp b/hwcomposer/qeglfsscreen.cpp
- index 8b9efb7..86c9fca 100644
- --- a/hwcomposer/qeglfsscreen.cpp
- +++ b/hwcomposer/qeglfsscreen.cpp
- @@ -41,7 +41,6 @@
- #include "qeglfsscreen.h"
- #include "qeglfswindow.h"
- -#include "qeglfspageflipper.h"
- #include <private/qmath_p.h>
- @@ -50,7 +49,6 @@ QT_BEGIN_NAMESPACE
- QEglFSScreen::QEglFSScreen(HwComposerContext *hwc, EGLDisplay dpy)
- : m_hwc(hwc)
- , m_dpy(dpy)
- - , m_pageFlipper(new QEglFSPageFlipper(this))
- {
- #ifdef QEGL_EXTRA_DEBUG
- qWarning("QEglScreen %p\n", this);
- @@ -59,16 +57,8 @@ QEglFSScreen::QEglFSScreen(HwComposerContext *hwc, EGLDisplay dpy)
- QEglFSScreen::~QEglFSScreen()
- {
- - delete m_pageFlipper;
- }
- -#if 0
- -QPlatformScreenPageFlipper *QEglFSScreen::pageFlipper() const
- -{
- - return m_pageFlipper;
- -}
- -#endif
- -
- QRect QEglFSScreen::geometry() const
- {
- diff --git a/rpm/qt5-qpa-hwcomposer-plugin.spec b/rpm/qt5-qpa-hwcomposer-plugin.spec
- index 69cbb0f..c574fce 100644
- --- a/rpm/qt5-qpa-hwcomposer-plugin.spec
- +++ b/rpm/qt5-qpa-hwcomposer-plugin.spec
- @@ -9,7 +9,7 @@ Source0: %{name}-%{version}.tar.bz2
- BuildRequires: pkgconfig(Qt5Core)
- BuildRequires: pkgconfig(Qt5Gui)
- BuildRequires: pkgconfig(Qt5DBus)
- -BuildRequires: pkgconfig(Qt5PlatformSupport)
- +BuildRequires: qt5-qtplatformsupport-devel >= 5.6.0
- BuildRequires: pkgconfig(egl)
- BuildRequires: pkgconfig(glesv2)
- BuildRequires: pkgconfig(wayland-egl)
- @@ -37,7 +37,7 @@ hwcomposer for composing content onto the screen.
- %build
- export QTDIR=/usr/share/qt5
- cd hwcomposer
- -%qmake5
- +%qmake5 DEFINES+=QT_NO_OPENGL_ES_3
- make %{_smp_mflags}
- %install
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement