purge video memory on nvidia
AbandonedPublic

Authored by mart on Jul 4 2016, 9:13 AM.

Details

Reviewers
graesslin
Summary

use the nvidia glx extension GLX_NV_robustness_video_memory_purge if available, in order to ensure the screen has correct content after resume or virtual terminal change on nvidia cards

Diff Detail

Repository
R108 KWin
Lint
Lint Skipped
Unit
Unit Tests Skipped
mart updated this revision to Diff 4926.Jul 4 2016, 9:13 AM
mart retitled this revision from to purge video memory on nvidia.
mart updated this object.
mart edited the test plan for this revision. (Show Details)
mart set the repository for this revision to R108 KWin.
mart added a project: KWin.
Restricted Application added a subscriber: kwin. · View Herald TranscriptJul 4 2016, 9:13 AM
graesslin added inline comments.Jul 4 2016, 9:50 AM
plugins/platforms/x11/standalone/glxbackend.cpp
48

nitpick, empty newline

301

QByteArrayLiteral

301–304

maybe we should not use an else-if here, but instead try the have_robustness if creating the context failed (like the other cases).

fredrik added a subscriber: fredrik.Jul 4 2016, 1:22 PM
fredrik added inline comments.
plugins/platforms/x11/standalone/glxbackend.cpp
300

Just an observation that this patch only enables the extension when kwin is configured to use the core profile.

mart abandoned this revision.Feb 28 2017, 12:05 PM

can't be tested by anyone, abandoning

@mart Please reopen, I have the hardware to test your patch.

plugins/platforms/x11/standalone/glxbackend.cpp
301

hasGLExtension("GLX_NV_robustness_video_memory_purge") returns false on my nvidia card + binary blob. Debug output shows that the glExtensions list in kwinglutils.cpp is empty.

graesslin added inline comments.Apr 3 2017, 4:32 PM
plugins/platforms/x11/standalone/glxbackend.cpp
301
Debug output shows that the glExtensions list in kwinglutils.cpp is empty.

That one is no longer used. You can check in KWin debug console (KRunner enter "KWin") in the OpenGL tab which extensions are available.

Damn, I had a comment unsubmitted for weeks.
Any chance we can get this in before Plasma 5.10?

plugins/platforms/x11/standalone/glxbackend.cpp
301

Ok the bug is that you need to use hasExtension() rather than hasGLExtension(). After this small change your patch works fine (I get the "Desktop effects were restarted" notification after switching VT!)

graesslin edited edge metadata.May 10 2017, 5:14 AM

@mart could you please incorporate the suggested change and then push to 5.8?