summaryrefslogtreecommitdiff
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>2018-01-05 08:26:04 +0000
commit718e8a018eda827797ea4568e9c40b221d4608e1 (patch)
tree178ae108ef253cf37363397fd9345c6979d20e31
parent154bdf45dd51a521058c820e7b871008ce8508ae (diff)
downloadqtwayland-718e8a018eda827797ea4568e9c40b221d4608e1.tar.gz
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. Backport from 5.10.0 to 5.9.4 Task-number: QTBUG-64631 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 2767d0533f2901517c87d9c99bcda26564484280) Change-Id: I2acf5574a1b792d3bbf928fb0bc328aa8ee8ffe0 Reviewed-by: Johan Helsing <johan.helsing@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 076a0d57..a0fcc532 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 b3513d15..9e8cba2e 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;