Bug 337560 - kwin should use OpenGL compositing on VMware
Summary: kwin should use OpenGL compositing on VMware
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-18 04:51 UTC by Loïc Yhuel
Modified: 2014-07-22 11:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.0.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Yhuel 2014-07-18 04:51:02 UTC
Kwin forces XRender compositing on VMware.

It wasn't a problem with KDE4 (but I don't know if it was really necessary), but with plasma 5 there are rendering issues : the panel blinks during animations, some parts pf the screen are not always redrawn properly, ...

Everything works better with KWIN_COMPOSE=O2.

OpenGL vendor string:                   VMware, Inc.
OpenGL renderer string:                 Gallium 0.4 on SVGA3D; build: RELEASE;  
OpenGL version string:                  2.1 Mesa 10.2.3
OpenGL shading language version string: 1.20
Driver:                                 VMware (SVGA3D)
GPU class:                              Unknown
OpenGL version:                         2.1
GLSL version:                           1.20
Mesa version:                           10.2.3
X server version:                       1.15.2
Linux kernel version:                   3.15.5
Requires strict binding:                yes
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        yes
Direct rendering: true 

Driver does not recommend OpenGL 2 compositing
OpenGL driver recommends XRender based compositing. Falling back to XRender.
Comment 1 Martin Flöser 2014-07-18 05:03:15 UTC
if you have a chance to test, please try:

diff --git a/libkwineffects/kwinglplatform.cpp 
b/libkwineffects/kwinglplatform.cpp                                                                                                                                                         
index 9a391a0..6fe57cb 100644                                                                                                                                                                                                              
--- a/libkwineffects/kwinglplatform.cpp
+++ b/libkwineffects/kwinglplatform.cpp
@@ -849,10 +849,12 @@ void GLPlatform::detect(OpenGLPlatformInterface 
platformInterface)
 
     if (isVirtualBox()) {
         m_virtualMachine = true;
+        m_recommendedCompositor = OpenGL2Compositing;
     }
 
     if (isVMware()) {
         m_virtualMachine = true;
+        m_recommendedCompositor = OpenGL2Compositing;
     }
 }
Comment 2 Loïc Yhuel 2014-07-18 05:59:12 UTC
It still started with XRender (perhaps some existing settings value), but with the patch I can switch to OpenGL in the kcm.

I don't know if VirtualBox should have the same settings, its OpenGL drivers are more limited.

Btw, the git master kwin seems to exit correctly when it's replaced, unlike the system one (kwin 5.0.0 from AUR). If the official tarball is the same as the Plasma/5.0 branch HEAD (there is no v5.0.0 tag), there is almost no difference from the master so I don't know why.
Comment 3 Martin Flöser 2014-07-18 06:08:49 UTC
> It still started with XRender (perhaps some existing settings value), but
> with the patch I can switch to OpenGL in the kcm.

yes, that's quite likely. You could give it a try by deleting any existing 
kwinrc.

> 
> I don't know if VirtualBox should have the same settings, its OpenGL drivers
> are more limited.

true - on the other hand we need OpenGL anyway for QtQuick and QtQuick 
requires a tat more than KWin. That's why I added it in both. It looks like an 
oversight that it was disabled.

> 
> Btw, the git master kwin seems to exit correctly when it's replaced, unlike
> the system one (kwin 5.0.0 from AUR). If the official tarball is the same
> as the Plasma/5.0 branch HEAD (there is no v5.0.0 tag), there is almost no
> difference from the master so I don't know why.

There is quite a huge difference already between branch and master. Master is 
using epoxy library for GL function name resolving.
Comment 4 Loïc Yhuel 2014-07-18 08:26:15 UTC
(In reply to Martin Gräßlin from comment #3)
> > It still started with XRender (perhaps some existing settings value), but
> > with the patch I can switch to OpenGL in the kcm.
> 
> yes, that's quite likely. You could give it a try by deleting any existing 
> kwinrc.
> 
Verified : I get OpenGL by default after removing kwinrc.
> > 
> > I don't know if VirtualBox should have the same settings, its OpenGL drivers
> > are more limited.
> 
> true - on the other hand we need OpenGL anyway for QtQuick and QtQuick 
> requires a tat more than KWin. That's why I added it in both. It looks like
> an 
> oversight that it was disabled.
> 
> > 
> > Btw, the git master kwin seems to exit correctly when it's replaced, unlike
> > the system one (kwin 5.0.0 from AUR). If the official tarball is the same
> > as the Plasma/5.0 branch HEAD (there is no v5.0.0 tag), there is almost no
> > difference from the master so I don't know why.
> 
> There is quite a huge difference already between branch and master. Master
> is 
> using epoxy library for GL function name resolving.
I'm not sure what would be the link. It's an heap corruption detected on exit, followed by a deadlock in glibc.
Comment 5 Martin Flöser 2014-07-18 08:38:50 UTC
On Friday 18 July 2014 08:26:15 you wrote:
> https://bugs.kde.org/show_bug.cgi?id=337560
> 
> --- Comment #4 from Loïc Yhuel <loic.yhuel@gmail.com> ---
> (In reply to Martin Gräßlin from comment #3)
> 
> > > It still started with XRender (perhaps some existing settings value),
> > > but
> > > with the patch I can switch to OpenGL in the kcm.
> > 
> > yes, that's quite likely. You could give it a try by deleting any existing
> > kwinrc.
> 
> Verified : I get OpenGL by default after removing kwinrc.

thanks for testing, I'll push the fix for 5.0.1
Comment 6 Martin Flöser 2014-07-22 11:27:22 UTC
Git commit 7f3b349ab36ac0d792359d3e304562cc00b164c1 by Martin Gräßlin.
Committed on 22/07/2014 at 11:21.
Pushed by graesslin into branch 'Plasma/5.0'.

Recommend OpenGL2 compositor for virtualbox and vmware

This ensures that those compositors are not forced to XRender.
FIXED-IN: 5.0.1

M  +2    -0    libkwineffects/kwinglplatform.cpp

http://commits.kde.org/kwin/7f3b349ab36ac0d792359d3e304562cc00b164c1