Bug 256654

Summary: Kwin slow performance using composite with r300g
Product: [Plasma] kwin Reporter: Cesar Garcia <cesarg9>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fredrik, imran1008, keplicz, papadako
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.6.0
Attachments: sysprof output using kwin 4.5.3 while moving a window
sysprof output using kwin 4.5.3 with r1189360 reversed
Possible fix

Description Cesar Garcia 2010-11-12 06:05:44 UTC
Version:           unspecified (using KDE 4.5.3) 
OS:                Linux

Kwin is very slow at moving, resizing, minimizing, etc. while using the desktop effects with the r300g drivers (mesa-7.9, xf86-video-ati-6-13.2, kernel 2.6.36, ATI Mobility X1400).

The problem goes away when downgrading kwin to 4.5.2 or reversing the commit(s) at http://websvn.kde.org/?view=revision&revision=1189360

Reproducible: Always

Steps to Reproduce:
Enable desktop effects

Actual Results:  
Window movement and effects are very slow

Expected Results:  
Smooth window movement/effects
Comment 1 Fredrik Höglund 2010-11-12 07:53:52 UTC
Could you try profiling this issue with sysprof so we can see where time is spent when moving a window?

Also, if you have trilinear filtering enabled, does it still happen if you disable it?
Comment 2 Cesar Garcia 2010-11-13 00:15:17 UTC
Not sure if i made it right (enabled CONFIG_PROFILING in the kernel, recompiled kwin/mesa/libdrm with -g and -fno-omit-frame-pointer), then launched sysprof and  moved a konqueror window non-stop across the screen during 20 seconds.
Comment 3 Cesar Garcia 2010-11-13 00:17:23 UTC
Created attachment 53371 [details]
sysprof output using kwin 4.5.3 while moving a window
Comment 4 Cesar Garcia 2010-11-13 00:18:42 UTC
Created attachment 53372 [details]
sysprof output using kwin 4.5.3 with r1189360 reversed
Comment 5 Cesar Garcia 2010-11-13 00:21:00 UTC
Almost forgot, i haven't using trilinear filtering, just the one named "nearest".
Comment 6 Papadakos Panagiotis 2011-01-08 02:06:04 UTC
Things are slow for me also using 2.6.37, r300g from a recent git mesa 7.11-devel and git xf-86-ati on my laptop's X2300. For example there seems to be a lag while starting moving a window and a smaller one while moving the window around. Another example, in the menu regarding widgets and activities at the top right corner, selections are updated slowly. I can clearly see the highlighting of each selection, if I move from the top selection to the bottom.

Unfortunately I can't test if 4.5.2 is ok for me, since I am using 4.6-rc2.
Comment 7 Imran Haider 2011-01-08 02:21:33 UTC
Actually, I tested with 4.5.2 and it performs much better than 4.5.3 (and higher versions).

My system: Arch Linux (kernel 2.6.35 32-bit) on CoreDuo with Radeon X1600 (using open-source drivers)

I'm running KDE 4.5.4 (except for kde-base-workspace which is 4.5.2). I also tested with 4.5.1 and its even better but plasma was not functioning properly, probably due to the kde-base-workspace version being too old compared to the rest of the KDE packages.
Comment 8 Papadakos Panagiotis 2011-01-08 11:27:45 UTC
Removing shadows make things snappier while moving. But the menu still is very slow...
Comment 9 Fredrik Höglund 2011-01-12 00:57:00 UTC
Created attachment 55891 [details]
Possible fix

Does this patch fix the problem?

Please note that it only applies to trunk and the 4.6 branch.
Comment 10 Cesar Garcia 2011-01-12 17:48:39 UTC
(In reply to comment #9)
> Created an attachment (id=55891) [details]
> Possible fix
> 
> Does this patch fix the problem?
> 
> Please note that it only applies to trunk and the 4.6 branch.
Nope, applied the patch to kwin-4.5.95 (4.6 rc2) and the window movements are still very slow with desktop effects enabled. Reverting the commit indicated in my first comment still fixes the issue for my r300g.
Comment 11 Francesco Cecconi 2011-01-14 16:33:13 UTC
same problem with r300g.

test:
kdebase-workspace 4.5.2, 4.5.5, trunk (with/without Fredrik patch)

System:
debian unstable, kernel 2.6.37, mesa 7.10 and llvm support
ati x300, xorg 7.6 and git xf86-video-ati
Comment 12 Papadakos Panagiotis 2011-01-17 18:30:38 UTC
I upgraded my kernel to 2.6.38 for pageflipping with updated x driver, and compiled latest mesa tree for optimizations:

http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f0348c4a2ba4f8ca812a2daccf3b01c3f984ef1

and 
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac6306e9ca904ae9674bf2a15222efe4cb861bf5

but unfortunately moving a window is still slow.
Comment 13 Fredrik Höglund 2011-01-19 00:11:16 UTC
SVN commit 1215519 by fredrik:

Don't specify the texture target explicitly with r300g.

This is reported to cause a performance regression.

FIXED-IN: 4.6.0
BUG: 256654


 M  +6 -0      scene_opengl.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1215519
Comment 14 Fredrik Höglund 2011-01-19 00:21:41 UTC
This commit should have the same effect as reverting the commit that caused the regression, but only for r300g.

I'm still not sure why that commit caused a performance problem with r300g, because in theory it should actually improve performance with all gallium drivers.
Comment 15 Martin Flöser 2011-01-31 22:06:52 UTC
Git commit 9028fcca0ab707715f372fc25c42e643764857b2 by Martin Gr����lin. on behalf of Fredrik H��glund
Pushed by graesslin into branch 'graesslin/kwin-coding-style'.

Don't specify the texture target explicitly with r300g.

This is reported to cause a performance regression.

FIXED-IN: 4.6.0
BUG: 256654

svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1215519

M  +1    -0    kwin/scene_opengl.cpp     
M  +15   -10   kwin/scene_opengl_glx.cpp     

http://commits.kde.org/a5d5b61a/9028fcca0ab707715f372fc25c42e643764857b2