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(-) 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(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 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; -- cgit v1.2.1 From 70fc4900ee70e786b615e1f31201564b946fd0ac Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 4 Jan 2018 12:06:06 +0100 Subject: Add changes file for Qt 5.9.4 Change-Id: I97a769b49357e9b92c9160bf8ba4bfdb51009af3 Reviewed-by: Johan Helsing --- dist/changes-5.9.4 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 dist/changes-5.9.4 diff --git a/dist/changes-5.9.4 b/dist/changes-5.9.4 new file mode 100644 index 00000000..70a2f54d --- /dev/null +++ b/dist/changes-5.9.4 @@ -0,0 +1,35 @@ +Qt 5.9.4 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.9.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.9 series is binary compatible with the 5.8.x series. +Applications compiled for 5.8 will continue to run with 5.9. Exception: +between Qt 5.8.0 and 5.9.0 the QWaylandQuickOutput class was changed +in a binary incompatible way. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + +**************************************************************************** +* Qt Wayland QPA Plugin 5.9.4 Changes * +**************************************************************************** + + - [QTBUG-64631] Fix freeze on resize with Weston and Qt Wayland Compositors + +**************************************************************************** +* Qt Wayland Compositor API 5.9.4 Changes * +**************************************************************************** + + - Fix memory leak when client attached a new Wayland buffer. + + - [QTBUG-64841] Fix decoding of multi-planar surfaces (YUV video) -- cgit v1.2.1 From 583ce658c38700b22d93329634d676b288118da4 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 5 Jan 2018 12:44:30 +0100 Subject: Fix protocol error when destroying xdg surfaces (v6) Destroy role object for toplevels when destroying the xdg surface. Task-number: QTBUG-65568 Change-Id: Ibe027c3eef8160f9fd2cfb05971c92ceb155f95b Reviewed-by: David Edmundson Reviewed-by: Pier Luigi Fiorini --- src/client/qwaylandxdgshellv6.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp index cd81778c..7473174d 100644 --- a/src/client/qwaylandxdgshellv6.cpp +++ b/src/client/qwaylandxdgshellv6.cpp @@ -125,6 +125,8 @@ QWaylandXdgSurfaceV6::QWaylandXdgSurfaceV6(QWaylandXdgShellV6 *shell, ::zxdg_sur QWaylandXdgSurfaceV6::~QWaylandXdgSurfaceV6() { + if (m_toplevel) + zxdg_toplevel_v6_destroy(m_toplevel->object()); if (m_popup) zxdg_popup_v6_destroy(m_popup->object()); destroy(); -- cgit v1.2.1 From 83db09bd0acaafb256880e3a217ed9df0641a00a Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 16 Jan 2018 12:02:30 +0100 Subject: Fix static builds with libwayland-egl There was a naming conflict between the client buffer integration, wayland-egl, and the system library libwayland-egl.so Rename the plugin binary to qt-plugin-wayland-egl to avoid the issue. Task-number: QTBUG-65652 Change-Id: Ib074c25e269a5e11b087fb4c3ddb15fef7d4a7ee Reviewed-by: Paul Olav Tvete --- src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro b/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro index d85c5efa..409cd37d 100644 --- a/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro +++ b/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro @@ -7,6 +7,8 @@ OTHER_FILES += \ SOURCES += main.cpp +TARGET = qt-plugin-wayland-egl + PLUGIN_TYPE = wayland-graphics-integration-client PLUGIN_CLASS_NAME = QWaylandEglClientBufferPlugin load(qt_plugin) -- cgit v1.2.1 From bf09c7a1493c01a65ee0f110b37a04e653edc08e Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 3 Jan 2018 19:18:42 +0000 Subject: Don't recreate hidden egl surfaces QWaylandEglWindow deletes surfaces when a window changes from hidden to visible, presumably as a result of us not having a valid wl_surface object. By extension it doesn't make sense to create a surface whilst a window is still hidden. This fixes a crash where a QQuickWindow hides and then is destroyed. In QQuickWindow destruction we have to create a valid context in order to delete any textures/assets owned by the scene graph; as the wl_surface has gone this causes an error in the EGL libs when we create an EGL surface. Task-number: QTBUG-65553 Change-Id: I9b37a86326bf2cd7737c4e839c1aa8c74cf08116 Reviewed-by: Johan Helsing --- .../client/wayland-egl/qwaylandglcontext.cpp | 2 +- tests/auto/client/client/tst_client.cpp | 37 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 2a9e39ed..f4dd6f49 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -407,7 +407,7 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) window->createDecoration(); if (eglSurface == EGL_NO_SURFACE) { - window->updateSurface(true); + window->updateSurface(window->isExposed()); eglSurface = window->eglSurface(); } diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp index 3897bd3b..aed601d8 100644 --- a/tests/auto/client/client/tst_client.cpp +++ b/tests/auto/client/client/tst_client.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -112,6 +114,25 @@ public: QPoint mousePressPos; }; +class TestGlWindow : public QOpenGLWindow +{ + Q_OBJECT + +public: + TestGlWindow(); + +protected: + void paintGL() override; +}; + +TestGlWindow::TestGlWindow() +{} + +void TestGlWindow::paintGL() +{ + glClear(GL_COLOR_BUFFER_BIT); +} + class tst_WaylandClient : public QObject { Q_OBJECT @@ -149,6 +170,7 @@ private slots: void dontCrashOnMultipleCommits(); void hiddenTransientParent(); void hiddenPopupParent(); + void glWindow(); private: MockCompositor *compositor; @@ -409,6 +431,21 @@ void tst_WaylandClient::hiddenPopupParent() QTRY_VERIFY(compositor->surface()); } +void tst_WaylandClient::glWindow() +{ + QSKIP("Skipping GL tests, as not supported by all CI systems: See https://bugreports.qt.io/browse/QTBUG-65802"); + + QScopedPointer testWindow(new TestGlWindow); + testWindow->show(); + QSharedPointer surface; + QTRY_VERIFY(surface = compositor->surface()); + + //confirm we don't crash when we delete an already hidden GL window + //QTBUG-65553 + testWindow->setVisible(false); + QTRY_VERIFY(!compositor->surface()); +} + int main(int argc, char **argv) { setenv("XDG_RUNTIME_DIR", ".", 1); -- cgit v1.2.1 From 6793a0a907f3aa92f8f8bd5448505c152d0e3a3d Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 8 Jan 2018 13:30:51 +0100 Subject: Fix requestUpdate() After commit 3e745ea053e42ba087438203df3bd76b30a08eb2, mFrameCallback is set to null when the next buffer is attached, not when the callback arrives. This means that a requestUpdate() after the frame callback would never be delivered. The solution is to test mWaitingForFrameSync instead. There is still a small race condition, but the failure case is that the update will arrive after 5 ms instead of exactly at frame sync. Change-Id: I413ed2b76c8527f825e501077bab712146b6705f Reviewed-by: Johan Helsing --- src/client/qwaylandwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 6d7c0885..d9870810 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -1029,7 +1029,7 @@ QVariant QWaylandWindow::property(const QString &name, const QVariant &defaultVa void QWaylandWindow::requestUpdate() { - if (!mFrameCallback) + if (!mWaitingForFrameSync) QPlatformWindow::requestUpdate(); else mUpdateRequested = true; -- cgit v1.2.1