Branch: r14.0.x

bc08650d 2018-06-24 12:41:57 Timothy Pearson
Fix kdesktop_lock screensaver stuttering on modern GPUs
(cherry picked from commit 4ec011cd55856f3825672431b15c0318022c6948)
M kdesktop/lock/lockprocess.cc

kdesktop/lock/lockprocess.cc

diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index dbe0da5..b4120f1 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -868,7 +868,11 @@
                 info = glXGetVisualFromFBConfig(x11Display(), fbc[j]);
                 if( info ) {
                     if (argb_visual) {
-                        if (info->depth < 32) {
+                        // Xorg can only use GPU compositing for ARGB32 8:8:8:8 visuals
+                        // Ensure the selected visual is 8 bits per RGB
+                        // Selecting a non-8-bit visual will result in stuttering and high
+                        // CPU load, while Xorg tries to composite each frame on the CPU!
+                        if ((info->depth < 32) || (info->bits_per_rgb != 8)) {
                             XFree( info );
                             info = NULL;
                             continue;