summaryrefslogtreecommitdiff
path: root/src/hardwareintegration/client
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-02-04 15:04:56 +0100
committerAndy Nichols <andy.nichols@digia.com>2014-02-04 15:04:56 +0100
commite5d1d051e413160e37e7b61d8d7ad74298f98a76 (patch)
tree804f966db6780b539ec90206017a1a79c006450b /src/hardwareintegration/client
parent05076e4e16615741becfc434979502901cbf396a (diff)
parent50f43a0c56e4329facbba6b7e4bbec0e87ff9d63 (diff)
downloadqtwayland-e5d1d051e413160e37e7b61d8d7ad74298f98a76.tar.gz
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h src/compositor/hardware_integration/qwaylandclientbufferintegrationplugin.h src/compositor/hardware_integration/qwaylandserverbufferintegrationplugin.h src/plugins/hardwareintegration/client/brcm-egl/main.cpp src/plugins/hardwareintegration/client/drm-egl-server/main.cpp src/plugins/hardwareintegration/client/wayland-egl/main.cpp src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp src/plugins/hardwareintegration/client/xcomposite-glx/main.cpp src/plugins/hardwareintegration/compositor/brcm-egl/main.cpp src/plugins/hardwareintegration/compositor/drm-egl-server/main.cpp src/plugins/hardwareintegration/compositor/wayland-egl/main.cpp src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp Change-Id: I9a9b418075970dd334babc3590b9b0315c2afb0d
Diffstat (limited to 'src/hardwareintegration/client')
-rw-r--r--src/hardwareintegration/client/brcm-egl/brcm-egl.pri17
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp11
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h8
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp38
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h7
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp4
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h2
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp2
-rw-r--r--src/hardwareintegration/client/wayland-egl/wayland-egl.pri2
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri2
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp9
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h8
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h4
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri2
14 files changed, 51 insertions, 65 deletions
diff --git a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
index 542c1c71..eb8e450f 100644
--- a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
+++ b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
@@ -1,5 +1,18 @@
INCLUDEPATH += $$PWD
-LIBS += -lEGL
+
+contains(QT_CONFIG, no-pkg-config) {
+ CONFIG += link_pkgconfig
+ PKGCONFIG += wayland-client
+} else {
+ LIBS += -lwayland-client
+}
+
+for(p, QMAKE_LIBDIR_EGL) {
+ exists($$p):LIBS += -L$$p
+}
+
+LIBS += $$QMAKE_LIBS_EGL
+INCLUDEPATH += $$QMAKE_INCDIR_EGL
SOURCES += $$PWD/qwaylandbrcmeglintegration.cpp \
$$PWD/qwaylandbrcmglcontext.cpp \
@@ -10,4 +23,4 @@ HEADERS += $$PWD/qwaylandbrcmeglintegration.h \
$$PWD/qwaylandbrcmeglwindow.h
CONFIG += wayland-scanner
-WAYLANDCLIENTSOURCES += ../../../extensions/brcm.xml
+WAYLANDCLIENTSOURCES += $$PWD/../../../extensions/brcm.xml
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp
index 197f4d2c..f1e14c10 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp
@@ -41,7 +41,7 @@
#include "qwaylandbrcmeglintegration.h"
-#include "qwaylandglintegration.h"
+#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
#include "qwaylandbrcmeglwindow.h"
#include "qwaylandbrcmglcontext.h"
@@ -52,11 +52,10 @@
QT_BEGIN_NAMESPACE
-QWaylandBrcmEglIntegration::QWaylandBrcmEglIntegration(QWaylandDisplay *waylandDisplay)
- : m_waylandDisplay(waylandDisplay->wl_display())
+QWaylandBrcmEglIntegration::QWaylandBrcmEglIntegration()
+ : m_waylandDisplay(0)
{
qDebug() << "Using Brcm-EGL";
- waylandDisplay->addRegistryListener(wlDisplayHandleGlobal, this);
}
void QWaylandBrcmEglIntegration::wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version)
@@ -78,8 +77,10 @@ QWaylandBrcmEglIntegration::~QWaylandBrcmEglIntegration()
eglTerminate(m_eglDisplay);
}
-void QWaylandBrcmEglIntegration::initialize()
+void QWaylandBrcmEglIntegration::initialize(QWaylandDisplay *waylandDisplay)
{
+ m_waylandDisplay = waylandDisplay->wl_display();
+ waylandDisplay->addRegistryListener(wlDisplayHandleGlobal, this);
EGLint major,minor;
m_eglDisplay = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY);
if (m_eglDisplay == NULL) {
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h
index f1100d8d..471f3a03 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h
@@ -42,7 +42,7 @@
#ifndef QWAYLANDBRCMEGLINTEGRATION_H
#define QWAYLANDBRCMEGLINTEGRATION_H
-#include "qwaylandglintegration.h"
+#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
@@ -59,13 +59,13 @@ class QWindow;
struct qt_brcm;
-class QWaylandBrcmEglIntegration : public QWaylandGLIntegration
+class QWaylandBrcmEglIntegration : public QWaylandClientBufferIntegration
{
public:
- QWaylandBrcmEglIntegration(QWaylandDisplay *waylandDisplay);
+ QWaylandBrcmEglIntegration();
~QWaylandBrcmEglIntegration();
- void initialize();
+ void initialize(QWaylandDisplay *waylandDisplay);
bool supportsThreadedOpenGL() const { return true; }
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
index 5c67ba8e..3ca72a77 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
@@ -41,8 +41,8 @@
#include "qwaylandbrcmeglwindow.h"
-#include "qwaylandbuffer.h"
-#include "qwaylandscreen.h"
+#include <QtWaylandClient/private/qwaylandbuffer_p.h>
+#include <QtWaylandClient/private/qwaylandscreen_p.h>
#include "qwaylandbrcmglcontext.h"
#include <QtPlatformSupport/private/qeglconvenience_p.h>
@@ -127,12 +127,12 @@ private:
QWaylandBrcmEglWindow::QWaylandBrcmEglWindow(QWindow *window)
: QWaylandWindow(window)
- , m_eglIntegration(static_cast<QWaylandBrcmEglIntegration *>(mDisplay->eglIntegration()))
+ , m_eglIntegration(static_cast<QWaylandBrcmEglIntegration *>(mDisplay->clientBufferIntegration()))
, m_eglConfig(0)
, m_format(window->format())
+ , m_eventQueue(wl_display_create_queue(mDisplay->wl_display()))
, m_current(0)
, m_count(0)
- , m_eventQueue(wl_display_create_queue(mDisplay->wl_display()))
{
}
@@ -249,38 +249,14 @@ void QWaylandBrcmEglWindow::swapBuffers()
}
m_buffers[m_current]->bind();
-
- m_mutex.lock();
- m_pending << m_buffers[m_current];
- m_mutex.unlock();
-
- // can't use a direct call since swapBuffers might be called from a separate thread
- QMetaObject::invokeMethod(this, "flushBuffers");
+ attach(m_buffers[m_current], 0, 0);
+ damage(QRect(QPoint(), geometry().size()));
+ commit();
m_current = (m_current + 1) % m_count;
-
m_buffers[m_current]->waitForRelease();
}
-void QWaylandBrcmEglWindow::flushBuffers()
-{
- if (m_pending.isEmpty())
- return;
-
- QSize size = geometry().size();
-
- m_mutex.lock();
- while (!m_pending.isEmpty()) {
- QWaylandBrcmBuffer *buffer = m_pending.takeFirst();
- attach(buffer, 0, 0);
- damage(QRect(QPoint(), size));
- commit();
- }
- m_mutex.unlock();
-
- mDisplay->flushRequests();
-}
-
bool QWaylandBrcmEglWindow::makeCurrent(EGLContext context)
{
if (!m_count)
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h
index 5a3fa046..bc8f12d1 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h
@@ -42,7 +42,7 @@
#ifndef QWAYLANDBRCMEGLWINDOW_H
#define QWAYLANDBRCMEGLWINDOW_H
-#include "qwaylandwindow.h"
+#include <QtWaylandClient/private/qwaylandwindow_p.h>
#include "qwaylandbrcmeglintegration.h"
#include <QMutex>
@@ -68,9 +68,6 @@ public:
bool makeCurrent(EGLContext context);
void swapBuffers();
-private slots:
- void flushBuffers();
-
private:
void createEglSurfaces();
void destroyEglSurfaces();
@@ -93,8 +90,6 @@ private:
int m_current;
int m_count;
- QList<QWaylandBrcmBuffer *> m_pending;
-
QMutex m_mutex;
};
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
index dfb86e54..85b7b49f 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
@@ -41,8 +41,8 @@
#include "qwaylandbrcmglcontext.h"
-#include "qwaylanddisplay.h"
-#include "qwaylandwindow.h"
+#include <QtWaylandClient/private/qwaylanddisplay_p.h>
+#include <QtWaylandClient/private/qwaylandwindow_p.h>
#include "qwaylandbrcmeglwindow.h"
#include <QtPlatformSupport/private/qeglconvenience_p.h>
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h
index 7beef166..a66c0a60 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h
@@ -42,7 +42,7 @@
#ifndef QWAYLANDBRCMGLCONTEXT_H
#define QWAYLANDBRCMGLCONTEXT_H
-#include "qwaylanddisplay.h"
+#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <qpa/qplatformopenglcontext.h>
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
index 1e86bd31..dc5bbc3b 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -90,7 +90,7 @@ void QWaylandEglWindow::setGeometry(const QRect &rect)
createDecoration();
QMargins margins = frameMargins();
- QSize sizeWithMargins = geometry().size() + QSize(margins.left() + margins.right(), margins.top() + margins.bottom());
+ QSize sizeWithMargins = rect.size() + QSize(margins.left() + margins.right(), margins.top() + margins.bottom());
if (m_waylandEglWindow) {
int current_width, current_height;
diff --git a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
index bf03a8c7..107a96f9 100644
--- a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
+++ b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
@@ -1,7 +1,7 @@
INCLUDEPATH += $$PWD
!contains(QT_CONFIG, no-pkg-config) {
CONFIG += link_pkgconfig
- PKGCONFIG += wayland-egl egl
+ PKGCONFIG += wayland-client wayland-egl egl
} else {
LIBS += -lwayland-egl -lEGL
}
diff --git a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri b/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri
index fa08daaf..89ec9840 100644
--- a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri
+++ b/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri
@@ -3,7 +3,7 @@ include($$PWD/../xcomposite_share/xcomposite_share.pri)
!contains(QT_CONFIG, no-pkg-config) {
CONFIG += link_pkgconfig
- PKGCONFIG += xcomposite egl x11
+ PKGCONFIG += wayland-client xcomposite egl x11
} else {
LIBS += -lXcomposite -lEGL -lX11
}
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp
index 62a9b0f3..b2c0dd5d 100644
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp
+++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp
@@ -49,15 +49,14 @@
QT_BEGIN_NAMESPACE
-QWaylandXCompositeGLXIntegration::QWaylandXCompositeGLXIntegration(QWaylandDisplay *waylandDisplay)
- : mWaylandDisplay(waylandDisplay)
+QWaylandXCompositeGLXIntegration::QWaylandXCompositeGLXIntegration()
+ : mWaylandDisplay(0)
, mWaylandComposite(0)
, mDisplay(0)
, mScreen(0)
, mRootWindow(0)
{
qDebug() << "Using XComposite-GLX";
- waylandDisplay->addRegistryListener(QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal, this);
}
QWaylandXCompositeGLXIntegration::~QWaylandXCompositeGLXIntegration()
@@ -65,8 +64,10 @@ QWaylandXCompositeGLXIntegration::~QWaylandXCompositeGLXIntegration()
XCloseDisplay(mDisplay);
}
-void QWaylandXCompositeGLXIntegration::initialize()
+void QWaylandXCompositeGLXIntegration::initialize(QWaylandDisplay *display)
{
+ mWaylandDisplay = display;
+ mWaylandDisplay->addRegistryListener(QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal, this);
}
QWaylandWindow * QWaylandXCompositeGLXIntegration::createEglWindow(QWindow *window)
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h
index 8e1d762d..17462915 100644
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h
+++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h
@@ -42,7 +42,7 @@
#ifndef QWAYLANDXCOMPOSITEGLXINTEGRATION_H
#define QWAYLANDXCOMPOSITEGLXINTEGRATION_H
-#include <QtWaylandClient/qwaylandglintegration.h>
+#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
#include <wayland-client.h>
#include <QtCore/QTextStream>
@@ -63,13 +63,13 @@ struct qt_xcomposite;
QT_BEGIN_NAMESPACE
-class QWaylandXCompositeGLXIntegration : public QWaylandGLIntegration
+class QWaylandXCompositeGLXIntegration : public QWaylandClientBufferIntegration
{
public:
- QWaylandXCompositeGLXIntegration(QWaylandDisplay * waylandDispaly);
+ QWaylandXCompositeGLXIntegration();
~QWaylandXCompositeGLXIntegration();
- void initialize();
+ void initialize(QWaylandDisplay *display);
bool waitingForEvents() { return !mDisplay; }
QWaylandWindow *createEglWindow(QWindow *window);
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h
index 88f417f2..9866ad03 100644
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h
+++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h
@@ -42,13 +42,13 @@
#ifndef QWAYLANDXCOMPOSITEGLXWINDOW_H
#define QWAYLANDXCOMPOSITEGLXWINDOW_H
-#include "qwaylandwindow.h"
+#include <QtWaylandClient/private/qwaylandwindow_p.h>
#include "qwaylandxcompositeglxintegration.h"
#include "qwaylandxcompositeglxcontext.h"
#include <QtCore/QWaitCondition>
-#include "qwaylandbuffer.h"
+#include <QtWaylandClient/private/qwaylandbuffer_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri b/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri
index cc41322b..3ecf5e7c 100644
--- a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri
+++ b/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri
@@ -3,7 +3,7 @@ include ($$PWD/../xcomposite_share/xcomposite_share.pri)
!contains(QT_CONFIG, no-pkg-config) {
CONFIG += link_pkgconfig
- PKGCONFIG += xcomposite gl x11
+ PKGCONFIG += wayland-client xcomposite gl x11
} else {
LIBS += -lXcomposite -lGL -lX11
}