summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorRebecca Worledge <rebecca.worlegde@digia.com>2013-11-12 14:34:21 +0200
committerJørgen Lind <jorgen.lind@digia.com>2013-11-13 09:07:50 +0100
commit36516e30b5daa84878a2b139db11a7358b7113ea (patch)
tree29ddb069503c6a7d6760d8f89bf5782ddd0a9955 /src/plugins
parentc77884d0b3fbf40d4770d40b3c2b2a62b17a75d2 (diff)
downloadqtwayland-36516e30b5daa84878a2b139db11a7358b7113ea.tar.gz
Fixes for BRCM integration
added a call to commit() after the flushBuffers, updated the buffer_release call to interate a single event queue. Removed the mutex and the wait condition. Change-Id: Icbde2fbb372ae319d0fbf9b4a9c98365102421a0 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp26
-rw-r--r--src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h2
2 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp
index 31db4328..c7073e14 100644
--- a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp
+++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp
@@ -54,6 +54,7 @@
#include <EGL/eglext_brcm.h>
#include "wayland-brcm-client-protocol.h"
+#include "wayland-client.h"
QT_BEGIN_NAMESPACE
@@ -64,10 +65,12 @@ public:
struct qt_brcm *brcm,
const QSize &size,
EGLint *data,
- int count)
+ int count,
+ struct wl_event_queue *eventQueue)
: m_size(size)
, m_released(true)
, m_display(display)
+ , m_eventQueue(eventQueue)
{
wl_array_init(&m_array);
m_data = static_cast<EGLint *>(wl_array_add(&m_array, count * sizeof(EGLint)));
@@ -76,6 +79,7 @@ public:
m_data[i] = data[i];
mBuffer = qt_brcm_create_buffer(brcm, size.width(), size.height(), &m_array);
+ wl_proxy_set_queue(reinterpret_cast<struct wl_proxy*>(mBuffer), m_eventQueue);
static const struct wl_buffer_listener buffer_listener = {
QWaylandBrcmBuffer::buffer_release
@@ -100,35 +104,27 @@ public:
{
if (m_released)
return;
- m_mutex.lock();
- while (!m_released)
- m_condition.wait(&m_mutex);
- m_mutex.unlock();
+ while (!m_released) {
+ wl_display_dispatch_queue(m_display->wl_display(), m_eventQueue);
+ }
}
static void buffer_release(void *data, wl_buffer *buffer)
{
Q_UNUSED(buffer);
- m_mutex.lock();
static_cast<QWaylandBrcmBuffer *>(data)->m_released = true;
- m_condition.wakeAll();
- m_mutex.unlock();
}
private:
- static QWaitCondition m_condition;
- static QMutex m_mutex;
QSize m_size;
bool m_released;
wl_array m_array;
EGLint *m_data;
QWaylandDisplay *m_display;
+ struct wl_event_queue *m_eventQueue;
};
-QWaitCondition QWaylandBrcmBuffer::m_condition;
-QMutex QWaylandBrcmBuffer::m_mutex;
-
QWaylandBrcmEglWindow::QWaylandBrcmEglWindow(QWindow *window)
: QWaylandWindow(window)
, m_eglIntegration(static_cast<QWaylandBrcmEglIntegration *>(mDisplay->eglIntegration()))
@@ -136,6 +132,7 @@ QWaylandBrcmEglWindow::QWaylandBrcmEglWindow(QWindow *window)
, m_format(window->format())
, m_current(0)
, m_count(0)
+ , m_eventQueue(wl_display_create_queue(mDisplay->wl_display()))
{
}
@@ -238,7 +235,7 @@ void QWaylandBrcmEglWindow::createEglSurfaces()
m_eglSurfaces[i] = eglCreatePixmapSurface(m_eglIntegration->eglDisplay(), m_eglConfig, (EGLNativePixmapType)&m_globalImages[5*i], attrs);
if (m_eglSurfaces[i] == EGL_NO_SURFACE)
qFatal("eglCreatePixmapSurface failed: %x, global image id: %d %d\n", eglGetError(), m_globalImages[5*i], m_globalImages[5*i+1]);
- m_buffers[i] = new QWaylandBrcmBuffer(mDisplay, m_eglIntegration->waylandBrcm(), size, &m_globalImages[5*i], 5);
+ m_buffers[i] = new QWaylandBrcmBuffer(mDisplay, m_eglIntegration->waylandBrcm(), size, &m_globalImages[5*i], 5, m_eventQueue);
}
}
@@ -277,6 +274,7 @@ void QWaylandBrcmEglWindow::flushBuffers()
QWaylandBrcmBuffer *buffer = m_pending.takeFirst();
attach(buffer, 0, 0);
damage(QRect(QPoint(), size));
+ commit();
}
m_mutex.unlock();
diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h
index 02abd244..5a3fa046 100644
--- a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h
+++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h
@@ -88,6 +88,8 @@ private:
QWaylandBrcmBuffer *m_buffers[3];
QSurfaceFormat m_format;
+ struct wl_event_queue *m_eventQueue;
+
int m_current;
int m_count;