[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin.spec
^
|
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/hwcomposer.pro
^
|
@@ -1,7 +1,7 @@
TARGET = hwcomposer
PLUGIN_TYPE = platforms
-PLUGIN_CLASS_NAME = QEglFSIntegrationPlugin
+PLUGIN_CLASS_NAME = QEglFShwcIntegrationPlugin
load(qt_plugin)
INCLUDEPATH += .
@@ -28,7 +28,7 @@
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 @@
$$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
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/hwcomposer_backend.cpp
^
|
@@ -128,6 +128,9 @@
#ifdef HWC_DEVICE_API_VERSION_1_4
case HWC_DEVICE_API_VERSION_1_4:
#endif
+#ifdef HWC_DEVICE_API_VERSION_1_5
+ case HWC_DEVICE_API_VERSION_1_5:
+#endif
// HWC_NUM_DISPLAY_TYPES is the actual size of the array, otherwise
// underrun/overruns happen
return new HwComposerBackend_v11(hwc_module, hwc_device, HWC_NUM_DISPLAY_TYPES);
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/hwcomposer_backend.h
^
|
@@ -80,7 +80,7 @@
{ int res; if ((res = (x)) != 0) \
qFatal("QPA-HWC: %s in %s returned %i", (#x), __func__, res); }
-static uint32_t interpreted_version(hw_device_t *hwc_device)
+inline static uint32_t interpreted_version(hw_device_t *hwc_device)
{
uint32_t version = hwc_device->version;
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/hwcomposer_backend_v10.cpp
^
|
@@ -146,6 +146,8 @@
HwComposerBackend_v10::~HwComposerBackend_v10()
{
+ hwc_device->eventControl(hwc_device, 0, HWC_EVENT_VSYNC, 0);
+
// Close the hwcomposer handle
HWC_PLUGIN_EXPECT_ZERO(hwc_close_1(hwc_device));
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/hwcomposer_backend_v11.cpp
^
|
@@ -48,6 +48,8 @@
#include <QtCore/QCoreApplication>
#include <private/qwindow_p.h>
+#include <private/qsystrace_p.h>
+
#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER1_API
// #define QPA_HWC_TIMING
@@ -71,6 +73,13 @@
static void hwc11_callback_vsync(const struct hwc_procs *procs, int, int64_t)
{
+ static int counter = 0;
+ ++counter;
+ if (counter % 2)
+ QSystrace::begin("graphics", "QPA::vsync", "");
+ else
+ QSystrace::end("graphics", "QPA::vsync", "");
+
QCoreApplication::postEvent(static_cast<const HwcProcs_v11 *>(procs)->backend, new QEvent(QEvent::User));
}
@@ -116,6 +125,8 @@
void HWComposer::present(HWComposerNativeWindowBuffer *buffer)
{
+ QSystraceEvent trace("graphics", "QPA::present");
+
QPA_HWC_TIMING_SAMPLE(presentTime);
fblayer->handle = buffer->handle;
@@ -139,8 +150,10 @@
QPA_HWC_TIMING_SAMPLE(prepareTime);
+ QSystrace::begin("graphics", "QPA::set", "");
err = hwcdevice->set(hwcdevice, num_displays, mlist);
HWC_PLUGIN_EXPECT_ZERO(err);
+ QSystrace::end("graphics", "QPA::set", "");
QPA_HWC_TIMING_SAMPLE(setTime);
@@ -158,6 +171,7 @@
, hwc_list(NULL)
, hwc_mList(NULL)
, num_displays(num_displays)
+ , m_displayOff(true)
{
procs = new HwcProcs_v11();
procs->invalidate = hwc11_callback_invalidate;
@@ -173,6 +187,8 @@
HwComposerBackend_v11::~HwComposerBackend_v11()
{
+ hwc_device->eventControl(hwc_device, 0, HWC_EVENT_VSYNC, 0);
+
// Close the hwcomposer handle
if (!qgetenv("QPA_HWC_WORKAROUNDS").split(',').contains("no-close-hwc"))
HWC_PLUGIN_EXPECT_ZERO(hwc_close_1(hwc_device));
@@ -246,6 +262,9 @@
bool tryToForceGLES = !qgetenv("QPA_HWC_FORCE_GLES").isEmpty();
layer->planeAlpha = tryToForceGLES ? 1 : 255;
#endif
+#ifdef HWC_DEVICE_API_VERSION_1_5
+ layer->surfaceDamage.numRects = 0;
+#endif
layer = &hwc_list->hwLayers[1];
memset(layer, 0, sizeof(hwc_layer_1_t));
@@ -271,6 +290,9 @@
#if (ANDROID_VERSION_MAJOR >= 4) && (ANDROID_VERSION_MINOR >= 3) || (ANDROID_VERSION_MAJOR >= 5)
layer->planeAlpha = 0xff;
#endif
+#ifdef HWC_DEVICE_API_VERSION_1_5
+ layer->surfaceDamage.numRects = 0;
+#endif
hwc_list->retireFenceFd = -1;
hwc_list->flags = HWC_GEOMETRY_CHANGED;
@@ -314,12 +336,24 @@
void
HwComposerBackend_v11::sleepDisplay(bool sleep)
{
+ m_displayOff = sleep;
if (sleep) {
+ // Stop the timer so we don't end up calling into eventControl after the
+ // screen has been turned off. Doing so leads to logcat errors being
+ // logged.
+ m_vsyncTimeout.stop();
+ hwc_device->eventControl(hwc_device, 0, HWC_EVENT_VSYNC, 0);
+
#ifdef HWC_DEVICE_API_VERSION_1_4
if (hwc_version == HWC_DEVICE_API_VERSION_1_4) {
HWC_PLUGIN_EXPECT_ZERO(hwc_device->setPowerMode(hwc_device, 0, HWC_POWER_MODE_OFF));
} else
#endif
+#ifdef HWC_DEVICE_API_VERSION_1_5
+ if (hwc_version == HWC_DEVICE_API_VERSION_1_5) {
+ HWC_PLUGIN_EXPECT_ZERO(hwc_device->setPowerMode(hwc_device, 0, HWC_POWER_MODE_OFF));
+ } else
+#endif
HWC_PLUGIN_EXPECT_ZERO(hwc_device->blank(hwc_device, 0, 1));
} else {
#ifdef HWC_DEVICE_API_VERSION_1_4
@@ -327,11 +361,22 @@
HWC_PLUGIN_EXPECT_ZERO(hwc_device->setPowerMode(hwc_device, 0, HWC_POWER_MODE_NORMAL));
} else
#endif
+#ifdef HWC_DEVICE_API_VERSION_1_5
+ if (hwc_version == HWC_DEVICE_API_VERSION_1_5) {
+ HWC_PLUGIN_EXPECT_ZERO(hwc_device->setPowerMode(hwc_device, 0, HWC_POWER_MODE_NORMAL));
+ } else
+#endif
HWC_PLUGIN_EXPECT_ZERO(hwc_device->blank(hwc_device, 0, 0));
if (hwc_list) {
hwc_list->flags |= HWC_GEOMETRY_CHANGED;
}
+
+ // If we have pending updates, make sure those start happening now..
+ if (m_pendingUpdate.size()) {
+ hwc_device->eventControl(hwc_device, 0, HWC_EVENT_VSYNC, 1);
+ m_vsyncTimeout.start(50, this);
+ }
}
}
@@ -366,7 +411,8 @@
{
if (e->type() == QEvent::User) {
static int idleTime = qBound(0, qgetenv("QPA_HWC_IDLE_TIME").toInt(), 100);
- m_deliverUpdateTimeout.start(idleTime, this);
+ if (!m_deliverUpdateTimeout.isActive())
+ m_deliverUpdateTimeout.start(idleTime, this);
return true;
}
return QObject::event(e);
@@ -374,6 +420,7 @@
void HwComposerBackend_v11::handleVSyncEvent()
{
+ QSystraceEvent trace("graphics", "QPA::handleVsync");
QSet<QWindow *> pendingWindows = m_pendingUpdate;
m_pendingUpdate.clear();
foreach (QWindow *w, pendingWindows) {
@@ -384,6 +431,10 @@
bool HwComposerBackend_v11::requestUpdate(QEglFSWindow *window)
{
+ // If the display is off, do updates via the normal Qt-based timer.
+ if (m_displayOff)
+ return false;
+
if (m_vsyncTimeout.isActive()) {
m_vsyncTimeout.stop();
} else {
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/hwcomposer_backend_v11.h
^
|
@@ -79,6 +79,7 @@
uint32_t hwc_version;
int num_displays;
+ bool m_displayOff;
QBasicTimer m_deliverUpdateTimeout;
QBasicTimer m_vsyncTimeout;
QSet<QWindow *> m_pendingUpdate;
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/main.cpp
^
|
@@ -44,20 +44,19 @@
QT_BEGIN_NAMESPACE
-class QEglFSIntegrationPlugin : public QPlatformIntegrationPlugin
+class QEglFShwcIntegrationPlugin : public QPlatformIntegrationPlugin
{
Q_OBJECT
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)
+QPlatformIntegration* QEglFShwcIntegrationPlugin::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;
}
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/qeglfscontext.cpp
^
|
@@ -42,7 +42,6 @@
#include "qeglfscontext.h"
#include "qeglfswindow.h"
#include "qeglfsintegration.h"
-#include "qeglfspageflipper.h"
#include <QtPlatformSupport/private/qeglpbuffer_p.h>
#include <QtGui/QSurface>
#include <QtDebug>
@@ -51,7 +50,6 @@
QEglFSContext::QEglFSContext(
HwComposerContext *hwc
- , QEglFSPageFlipper *pageFlipper
, const QSurfaceFormat &format
, QPlatformOpenGLContext *share
, EGLDisplay display
@@ -63,12 +61,12 @@
hwc->surfaceFormatFor(format)
, share
, display
- , QEglFSIntegration::chooseConfig(display, hwc->surfaceFormatFor(format))
+ , &(m_config = QEglFSIntegration::chooseConfig(display, hwc->surfaceFormatFor(format)))
#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
, eglApi
#endif
),
- m_hwc(hwc), m_pageFlipper(pageFlipper), m_swapIntervalConfigured(false)
+ m_hwc(hwc), m_swapIntervalConfigured(false)
{
}
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/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,7 +52,7 @@
class QEglFSContext : public QEGLPlatformContext
{
public:
- QEglFSContext(HwComposerContext *hwc, QEglFSPageFlipper *pageFlipper,
+ 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);
@@ -65,7 +64,7 @@
void swapBuffers(QPlatformSurface *surface);
private:
HwComposerContext *m_hwc;
- QEglFSPageFlipper *m_pageFlipper;
+ EGLConfig m_config;
bool m_swapIntervalConfigured;
};
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/qeglfsintegration.cpp
^
|
@@ -63,7 +63,6 @@
#include <qpa/qplatforminputcontextfactory_p.h>
#include "qeglfscontext.h"
-#include "qeglfspageflipper.h"
#include <EGL/egl.h>
@@ -115,7 +114,11 @@
QEglFSIntegration::~QEglFSIntegration()
{
+#if QT_VERSION >= 0x050500
+ destroyScreen(mScreen);
+#else
delete mScreen;
+#endif
eglTerminate(mDisplay);
delete mHwc;
@@ -150,7 +153,7 @@
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
@@ -197,8 +200,8 @@
mHwc->sleepDisplay(true);
} else if (lowerCaseResource == "displayon") {
// Called from lipstick to turn on the display (src/homeapplication.cpp)
- mHwc->sleepDisplay(false);
- }
+ mHwc->sleepDisplay(false);
+ }
return NULL;
}
@@ -246,7 +249,7 @@
QPlatformTheme *QEglFSIntegration::createPlatformTheme(const QString &name) const
{
- if (name == QLatin1String("generic_qeglfs"))
+ if (name == QLatin1String("generic_eglfs"))
return new GenericEglFSTheme;
return GenericEglFSTheme::createUnixTheme(name);
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.2.tar.bz2/hwcomposer/qeglfsscreen.cpp
^
|
@@ -41,7 +41,6 @@
#include "qeglfsscreen.h"
#include "qeglfswindow.h"
-#include "qeglfspageflipper.h"
#include <private/qmath_p.h>
@@ -49,7 +48,6 @@
QEglFSScreen::QEglFSScreen(HwComposerContext *hwc, EGLDisplay dpy)
: m_hwc(hwc)
- , m_pageFlipper(new QEglFSPageFlipper(this))
, m_dpy(dpy)
{
#ifdef QEGL_EXTRA_DEBUG
@@ -59,17 +57,8 @@
QEglFSScreen::~QEglFSScreen()
{
- delete m_pageFlipper;
}
-#if 0
-QPlatformScreenPageFlipper *QEglFSScreen::pageFlipper() const
-{
- return m_pageFlipper;
-}
-#endif
-
-
QRect QEglFSScreen::geometry() const
{
return QRect(QPoint(0, 0), m_hwc->screenSize());
|