Review Request 128763: WindowThumbnail: Do GL calls in the correct thread

David Edmundson david at davidedmundson.co.uk
Fri Sep 2 16:42:28 UTC 2016



> On Sept. 2, 2016, 8:11 a.m., Martin Gräßlin wrote:
> > src/declarativeimports/core/windowthumbnail.cpp, lines 482-493
> > <https://git.reviewboard.kde.org/r/128763/diff/2/?file=475855#file475855line482>
> >
> >     what about these commented lines?

I've replaced it with a call to releaseResources() so that it will clean up if we do ever get in this state. I think it's won't, but it'll just no-op in that case anyway)


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128763/#review98827
-----------------------------------------------------------


On Sept. 1, 2016, 10:50 a.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128763/
> -----------------------------------------------------------
> 
> (Updated Sept. 1, 2016, 10:50 a.m.)
> 
> 
> Review request for KDE Frameworks and Plasma.
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> -------
> 
> WindowThumbnail did some open GL operations, discarding old textures, in the GUI thread. Whislt it's not going to cause a threading issue (as updatePaintNode always ran when the main thread was blocked) we're not meant to mix threads with openGL contexts.
> 
> It also seems to have a GL leak on nvidia, which was previously masked
> by the double delete fixed in https://git.reviewboard.kde.org/r/126131/diff/2/
> It seems only one worked, and in the applied version we went with the wrong one.
> 
> This patch makes use of QQuickItem::releaseResources to delete the GL
> textures on window change and destructor; it's then removed from
> stopRedirecting so that start/stop redirecting handles xcb on the GUI thread and updatePaintNode/discardPixmap is the GL stuff on the render thread. 
> 
> See http://doc.qt.io/qt-5/qquickitem.html#graphics-resource-handling
> 
> REVIEW:
> 
> 
> Diffs
> -----
> 
>   src/declarativeimports/core/windowthumbnail.h 7276f95de16e71006618f3282d8eaf419a199d1d 
>   src/declarativeimports/core/windowthumbnail.cpp d106994315099ab6e6f948c31a606d5309ae03e2 
> 
> Diff: https://git.reviewboard.kde.org/r/128763/diff/
> 
> 
> Testing
> -------
> 
> Using nvidia with proprietory drivers (which puts me QSG_RENDER_LOOP=threaded) mouse over the panel a lot. VRAM didn't increase. Previews still appear. 
> "Used Dedicated Memory:" in nvidia-settings remained roughly static, rather than constantly increasing.
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160902/d8efb112/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list