summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2017-11-21 10:13:43 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2017-11-21 10:33:03 +0000
commit2767d0533f2901517c87d9c99bcda26564484280 (patch)
treec3409dc6a4a3dc5f034d9bf4682ee05bb1d2d1f2
parentb6ac922f1af207725e91fe5de0ea3ad0919d8026 (diff)
Revert "Ref count buffer usage"
When a buffer is committed multiple times, not all compositors (i.e. Weston) send a matching number of release events. This caused clients to freeze on some occasions on those compositors because they were waiting for a release event that never came. This reverts commit 5f38652cd52c03e9df8600f5f41e044820c3062c. Task-number: QTBUG-64631 Change-Id: I818d9bd71e5d9ce7a351a2010914b7219b1975bc Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--src/client/qwaylandbuffer.cpp2
-rw-r--r--src/client/qwaylandbuffer_p.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/client/qwaylandbuffer.cpp b/src/client/qwaylandbuffer.cpp
index 076a0d57d..a0fcc532f 100644
--- a/src/client/qwaylandbuffer.cpp
+++ b/src/client/qwaylandbuffer.cpp
@@ -66,7 +66,7 @@ void QWaylandBuffer::init(wl_buffer *buf)
void QWaylandBuffer::release(void *data, wl_buffer *)
{
- static_cast<QWaylandBuffer *>(data)->mBusy--;
+ static_cast<QWaylandBuffer *>(data)->mBusy = false;
}
const wl_buffer_listener QWaylandBuffer::listener = {
diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h
index b3513d151..9e8cba2e4 100644
--- a/src/client/qwaylandbuffer_p.h
+++ b/src/client/qwaylandbuffer_p.h
@@ -73,14 +73,14 @@ public:
virtual QSize size() const = 0;
virtual int scale() const { return 1; }
- void setBusy() { mBusy++; }
- bool busy() const { return mBusy > 0; }
+ void setBusy() { mBusy = true; }
+ bool busy() const { return mBusy; }
protected:
struct wl_buffer *mBuffer;
private:
- int mBusy;
+ bool mBusy;
static void release(void *data, wl_buffer *);
static const wl_buffer_listener listener;