Accepting request 512501 from KDE:Qt5

- Add patch to revert upstream commit introducing a massive memory
  leak (QTBUG-62117):
  * revert-delay-deletion-of-qsgtextures.patch

OBS-URL: https://build.opensuse.org/request/show/512501
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtdeclarative?expand=0&rev=41
This commit is contained in:
Dominique Leuenberger 2017-07-28 07:40:38 +00:00 committed by Git OBS Bridge
parent 06030bbdf3
commit 55e2a545d6
3 changed files with 231 additions and 0 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jul 24 19:17:08 UTC 2017 - fabian@ritter-vogt.de
- Add patch to revert upstream commit introducing a massive memory
leak (QTBUG-62117):
* revert-delay-deletion-of-qsgtextures.patch
-------------------------------------------------------------------
Mon Jul 17 19:07:46 UTC 2017 - fabian@ritter-vogt.de

View File

@ -39,6 +39,8 @@ Patch1: support-non-integer-pixel-ratios-qquickwidget.patch
Patch2: rebuild-qqmldata-propertycache-if-deleted.patch
# PATCH-FIX-OPENSUSE sse2_nojit.patch -- enable JIT and sse2 only on sse2 case
Patch100: sse2_nojit.patch
# PATCH-FIX-OPENSUSE
Patch101: revert-delay-deletion-of-qsgtextures.patch
BuildRequires: fdupes
BuildRequires: libQt5Core-private-headers-devel >= %{version}
BuildRequires: libQt5Gui-private-headers-devel >= %{version}
@ -80,6 +82,7 @@ handling.
%ifarch %ix86
%patch100 -p1
%endif
%patch101 -p1
%package -n %libname
Summary: Qt 5 Declarative Library

View File

@ -0,0 +1,221 @@
From eeb320bbd8763f3e72f79369cc3908e999a0da3c Mon Sep 17 00:00:00 2001
From: Dominik Holland <dominik.holland@pelagicore.com>
Date: Thu, 2 Mar 2017 15:25:07 +0100
Subject: [PATCH] Delay the deletion of QSGTextures until all windows are
synchronized
With the 'basic' and the 'windows' render loop the scene graph
context is shared. Because of this we cannot start deleting textures
after the first window is synchronized as it may contain textures
needed by the another window, which is not yet synchronized.
QWindowPrivate::syncSceneGraph() is not calling endSync() anymore
as it doesn't know whether it is the last window or not. Instead
the renderloop is now responsible for calling endSync() once this
is safe to do.
Change-Id: Icb50ebfb447c928e38b41df7e26f3bfafdb4a811
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
---
src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp | 1 +
src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp | 2 ++
src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp | 1 +
src/quick/items/qquickrendercontrol.cpp | 3 +++
src/quick/items/qquickwindow.cpp | 2 --
.../adaptations/software/qsgsoftwarerenderloop.cpp | 1 +
.../adaptations/software/qsgsoftwarethreadedrenderloop.cpp | 2 ++
src/quick/scenegraph/qsgrenderloop.cpp | 12 ++++++++++++
src/quick/scenegraph/qsgthreadedrenderloop.cpp | 1 +
src/quick/scenegraph/qsgwindowsrenderloop.cpp | 10 ++++++++++
10 files changed, 33 insertions(+), 2 deletions(-)
Index: qtdeclarative-opensource-src-5.9.1/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
@@ -461,7 +461,6 @@ void QSGD3D12RenderLoop::renderWindow(QQ
data.rc->initialize(nullptr);
wd->syncSceneGraph();
- data.rc->endSync();
if (profileFrames)
syncTime = renderTimer.nsecsElapsed();
Index: qtdeclarative-opensource-src-5.9.1/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
@@ -410,7 +410,6 @@ bool QSGD3D12RenderThread::event(QEvent
QQuickWindowPrivate *wd = QQuickWindowPrivate::get(wme->window);
rc->initialize(nullptr);
wd->syncSceneGraph();
- rc->endSync();
wd->renderSceneGraph(wme->window->size());
*wme->image = engine->executeAndWaitReadbackRenderTarget();
}
@@ -546,7 +545,6 @@ void QSGD3D12RenderThread::sync(bool inE
rc->initialize(nullptr);
wd->syncSceneGraph();
- rc->endSync();
if (!hadRenderer && wd->renderer) {
if (Q_UNLIKELY(debug_loop()))
Index: qtdeclarative-opensource-src-5.9.1/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
@@ -205,7 +205,6 @@ void QSGOpenVGRenderLoop::renderWindow(Q
emit window->afterAnimating();
cd->syncSceneGraph();
- rc->endSync();
if (profileFrames)
syncTime = renderTimer.nsecsElapsed();
Index: qtdeclarative-opensource-src-5.9.1/src/quick/items/qquickrendercontrol.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/quick/items/qquickrendercontrol.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/quick/items/qquickrendercontrol.cpp
@@ -284,7 +284,6 @@ bool QQuickRenderControl::sync()
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(d->window);
cd->syncSceneGraph();
- d->rc->endSync();
// TODO: find out if the sync actually caused a scenegraph update.
return true;
@@ -384,7 +383,6 @@ QImage QQuickRenderControl::grab()
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(d->window);
cd->polishItems();
cd->syncSceneGraph();
- d->rc->endSync();
render();
grabContent = qt_gl_read_framebuffer(d->window->size() * d->window->effectiveDevicePixelRatio(), false, false);
if (QQuickRenderControl::renderWindowFor(d->window)) {
@@ -404,7 +402,6 @@ QImage QQuickRenderControl::grab()
softwareRenderer->markDirty();
cd->polishItems();
cd->syncSceneGraph();
- d->rc->endSync();
render();
softwareRenderer->setCurrentPaintDevice(prevDev);
}
Index: qtdeclarative-opensource-src-5.9.1/src/quick/items/qquickwindow.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/quick/items/qquickwindow.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/quick/items/qquickwindow.cpp
@@ -432,8 +432,10 @@ void QQuickWindowPrivate::syncSceneGraph
emit q->afterSynchronizing();
runAndClearJobs(&afterSynchronizingJobs);
+ context->endSync();
}
+
void QQuickWindowPrivate::renderSceneGraph(const QSize &size)
{
QML_MEMORY_SCOPE_STRING("SceneGraph");
Index: qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
@@ -149,7 +149,6 @@ void QSGSoftwareRenderLoop::renderWindow
emit window->afterAnimating();
cd->syncSceneGraph();
- rc->endSync();
if (profileFrames)
syncTime = renderTimer.nsecsElapsed();
Index: qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
@@ -330,7 +330,6 @@ bool QSGSoftwareRenderThread::event(QEve
softwareRenderer->setBackingStore(backingStore);
rc->initialize(nullptr);
wd->syncSceneGraph();
- rc->endSync();
wd->renderSceneGraph(wme->window->size());
*wme->image = backingStore->handle()->toImage();
}
@@ -444,7 +443,6 @@ void QSGSoftwareRenderThread::sync(bool
rc->initialize(nullptr);
wd->syncSceneGraph();
- rc->endSync();
if (!hadRenderer && wd->renderer) {
qCDebug(QSG_RASTER_LOG_RENDERLOOP, "RT - created renderer");
Index: qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/qsgrenderloop.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/quick/scenegraph/qsgrenderloop.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/qsgrenderloop.cpp
@@ -380,16 +380,6 @@ void QSGGuiThreadRenderLoop::renderWindo
bool alsoSwap = data.updatePending;
data.updatePending = false;
- bool lastDirtyWindow = true;
- auto i = m_windows.constBegin();
- while (i != m_windows.constEnd()) {
- if (i.value().updatePending) {
- lastDirtyWindow = false;
- break;
- }
- i++;
- }
-
if (!current)
return;
@@ -417,8 +407,6 @@ void QSGGuiThreadRenderLoop::renderWindo
emit window->afterAnimating();
cd->syncSceneGraph();
- if (lastDirtyWindow)
- rc->endSync();
if (profileFrames)
syncTime = renderTimer.nsecsElapsed();
Index: qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/qsgthreadedrenderloop.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -425,7 +425,6 @@ bool QSGRenderThread::event(QEvent *e)
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- sync scene graph";
QQuickWindowPrivate *d = QQuickWindowPrivate::get(ce->window);
d->syncSceneGraph();
- sgrc->endSync();
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- rendering scene graph";
QQuickWindowPrivate::get(ce->window)->renderSceneGraph(ce->window->size());
Index: qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/qsgwindowsrenderloop.cpp
===================================================================
--- qtdeclarative-opensource-src-5.9.1.orig/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ qtdeclarative-opensource-src-5.9.1/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -445,14 +445,6 @@ void QSGWindowsRenderLoop::renderWindow(
}
}
- bool lastDirtyWindow = true;
- for (int i=0; i<m_windows.size(); ++i) {
- if ( m_windows[i].pendingUpdate) {
- lastDirtyWindow = false;
- break;
- }
- }
-
d->flushFrameSynchronousEvents();
// Event delivery or processing has caused the window to stop rendering.
if (!windowData(window))
@@ -472,8 +464,6 @@ void QSGWindowsRenderLoop::renderWindow(
RLDEBUG(" - syncing");
d->syncSceneGraph();
- if (lastDirtyWindow)
- m_rc->endSync();
QSG_RENDER_TIMING_SAMPLE(QQuickProfiler::SceneGraphRenderLoopFrame, time_synced,
QQuickProfiler::SceneGraphRenderLoopSync);