From 718e8a018eda827797ea4568e9c40b221d4608e1 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 21 Nov 2017 10:13:43 +0100 Subject: 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 Reviewed-by: Paul Olav Tvete (cherry picked from commit 2767d0533f2901517c87d9c99bcda26564484280) Change-Id: I2acf5574a1b792d3bbf928fb0bc328aa8ee8ffe0 Reviewed-by: Johan Helsing --- src/client/qwaylandbuffer.cpp | 2 +- src/client/qwaylandbuffer_p.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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(data)->mBusy--; + static_cast(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; -- cgit v1.2.3