Bug 184059

Summary: unredirect fullscreen windows does not work
Product: [Plasma] kwin Reporter: Harald Nikolisin <hochglanz>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ash.hunter, getaceres, hochglanz, mail
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Harald Nikolisin 2009-02-11 22:17:46 UTC
Version:            (using KDE 4.2.0)
OS:                Linux
Installed from:    SuSE RPMs

If I understand correctly the yet closed bug report 165237, fullscreen OpenGL apps should not suffer of performance when executed on KDE 4.2

The opposite is still the case on an nVIDIA (latest stable, 180.22) system. All 3D applications using OpenGL have a massive drop in FPS when running on KDE 4.2

On example is...

http://global.phoronix-test-suite.com/?k=profile&u=anon-7316-9190-2824

where is use the Phoronix X-plane9 Test (fullscreen) on the same computer on KDE 4.2 and IceWM.
I run also frequently benchmark test with the computer game X2 - currently I got 34-35 FPS with IceWM, whereas I got 10-13 FPS on KDE 4.2
Comment 1 Jose 2009-02-18 22:09:29 UTC
I'm playing World of Goo and I get a huge performance drop if desktop effects are activated. I thought that KWin 4.2 was supposed to disable desktop effects when it detected a Fullscreen OpenGL window but it seems this is not the case.
Comment 2 Harald Nikolisin 2009-03-21 23:38:09 UTC
Meanwhile I updated the nVIDIA driver to pre-release 180.37 - the problem still remains.
I tested some things and I noticed that OpenGL performance on the KDE 4.2 desktop is very unreliable. Sometimes you have perfect performance, sometimes it's horrible.

Now I tested a complete series of the glmark test from the Phoronix test suite 1.6.0 - and got very suprings effects
These are the URL's of the test results

http://global.phoronix-test-suite.com/?k=profile&u=anon-2166-22771-12327
http://global.phoronix-test-suite.com/?k=profile&u=anon-16885-26595-1599
http://global.phoronix-test-suite.com/?k=profile&u=anon-1295-6555-22438
http://global.phoronix-test-suite.com/?k=profile&u=anon-24717-8878-13906

Have a look at the first test, it's the subtest "VertexArray" from the Phoronix glmark test.
I used the nvidia-settings tool to declare "overide application settings" on Antialiasing:
I tested it on IceWM:
With FSAA2MS (2xMultisampling): 798fps
With FSAA4MS (4xMultisampling): 531fps
With FSAA4SS2MS (4xSupersampling,2xMultisampling): 15fps
On KDE 4.2 I got:
FSAA2MS: 164fps
FSAA4MS: 88fps
FSAA4SS2MSS: 15fps

=> One can clearly see that KDE 4.2 leads to a extreme drop of fps. But with the highest tested AA-setting the 15fps are equal on IceWM & KDE 4.2

Have a look at the same test on the external monitor with 1680x1050 resolution
On IceWM:
FSAA2MS: 602fps
FSAA4MS: 64fps
FSAA4SS2MSS: 11fps
On KDE 4.2:
FSAA2MS: 43fps
FSAA4MS: 23fps
FSAA4SS2MSS: 609fps

Obviously the most interesting fact is that the the highest AA-setting on KDE 4.2 leads to huge performance gain. The achieved fps is nearly the same as the result of FSAA2MS on IceWM.

=> Therefore I assume that kwin manipulates automatically the AA setting according to some algorithms.
This would explain that benchmark tests of OpenGL apps are very unreiable but shows mostly a huge performance drop to other WindowManagers without Compositing effects.

Last hint:
I got absolutely no positive effect if I deactivate the desktop effect within KDE 4.2
Comment 3 Ash Hunter 2009-07-19 13:04:27 UTC
This problem still exists in KDE 4.3-rc2 (4.2.96). I tried running Penumbra Overture on a Radeon HD 2400, and it was unplayable with desktop effects enabled, but if I disabled compositing/desktop effects first it was fine.

So what should happen is that even if unredirect-fullscreen is working fine for the fullscreen window itself, the fact that compositing is still enabled can still have a detrimental effect on 3D games/apps. I know you could argue this is a video driver bug, but I think the safer solution would be to disable desktop effects entirely while a fullscreen OpenGL application is running.
Comment 4 Martin Flöser 2009-07-19 13:16:47 UTC
Unfortunatelly the apps do not tell the window manager that they use OpenGL and in general disabling them would be wrong as it should not be any problem any more with DRI2 and also depends very much on drivers.

KWin provides a DBus interface to query if compositing is active and provides a DBus method to suspend compositing. Each application is free to use this if they know that it doesn't work well with compositing. They know it we can't.

You can even create an own little script (taken from bug #198744 comment #10)

composited='qdbus org.kde.kwin /KWin compositingActive'
if $composited; then qdbus org.kde.kwin /KWin toggleCompositing; fi
app_to_be_executed
if $composited; then qdbus org.kde.kwin /KWin toggleCompositing; fi
Comment 5 Ash Hunter 2009-07-19 15:26:37 UTC
I don't think DRI2 will arrive in the fglrx drivers any time soon unfortunately...

I'm now of the opinion that the suggestion in bug 170293 to add a "disable compositing" option to the .desktop launcher file would be a fantastic solution to this problem that a user could set easily per application that needs it disabled.
Comment 6 Martin Flöser 2011-01-22 12:51:07 UTC
Drop of FPS with a composited window manager is to be expected and also quite ok-ish. Nobody needs 300 FPS ;-) I set to duplicate of the wish to disable compositing for special applications.

*** This bug has been marked as a duplicate of bug 170293 ***
Comment 7 Harald Nikolisin 2011-01-24 00:51:45 UTC
martin, this bug still exists!

Because bug 165237 could not be modified any longer, I reopened this bug to mention that fullscreen application does automatically suspend desktop effects - which is simply not true.
It was not true with KDE 4.2.2 and it is still not with KDE 4.5.5
Verify it with Phoronix X-Plane test (mentioned above) or a fullscreen application of your choice.

I also support bug 170293 which demands for an option for every application (not only the fullscreen apps) - it is not a duplicate of this bug (or vice versa)

harald
Comment 8 Martin Flöser 2011-01-24 07:24:32 UTC
> Because bug 165237 could not be modified any longer, I reopened this bug
> to mention that fullscreen application does automatically suspend
> desktop effects - which is simply not true.
> It was not true with KDE 4.2.2 and it is still not with KDE 4.5.5
well no. It does not get suspended, the fullscreen window gets unredirected. This works (confirmed by bug reports) unless another window is on top or the fullscreen window uses argb.
> Verify it with Phoronix X-Plane test (mentioned above) or a fullscreen
> application of your choice.
yes, unredirection works.
> I also support bug 170293 which demands for an option for every
> application (not only the fullscreen apps) - it is not a duplicate of
> this bug (or vice versa)
if you want full suspending of compositing and not only unredirection of fullscreen windows, then it's a dupplicate.