Bug 172549 - Revision 866710 (flicker fix) causes excessive CPU consumption
Summary: Revision 866710 (flicker fix) causes excessive CPU consumption
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-10 22:14 UTC by Kevin Kofler
Modified: 2008-10-19 03:09 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Kofler 2008-10-10 22:14:33 UTC
Version:           4.1.2 + panel autohide from trunk (using KDE 4.1.2)
Compiler:          g++ 4.3 
OS:                Linux
Installed from:    Fedora RPMs

This is a bug we noticed while testing a backport of panel auto-hiding to KDE 4.1.2, but I believe it also affects the trunk: after applying:
1. this backport from trunk:
http://cvs.fedoraproject.org/viewvc/rpms/kdebase-workspace/devel/kdebase-workspace-4.1.2-panel-autohide.patch?revision=1.2&view=markup
and
2. http://websvn.kde.org/?view=rev&revision=866710
Plasma's CPU consumption when idle with the panel shown raises to insane levels (on several different machines): with compositing enabled, it's around 20-50%, with compositing disabled, around 99-100% (!). If I disable revision 866710 (and revision 866715 which I had included in the same backport: http://cvs.fedoraproject.org/viewvc/rpms/kdebase-workspace/devel/kdebase-workspace-4.1.2-panel-autohide-fix-flicker.patch?revision=1.2&view=markup , but I doubt it's that one as it only touches the panel controller which isn't being shown at all when this happens), the CPU consumption is back down to reasonable levels.

I believe the offending change to be the one to the event handler:
+bool PanelView::event(QEvent *event)
+{
+    if (event->type() == QEvent::Paint) {
+        QPainter p(this);
+        p.setCompositionMode(QPainter::CompositionMode_Source);
+        p.fillRect(rect(), Qt::transparent);
+    }
+    return Plasma::View::event(event);
+}
This resets the background to transparent at *every single* paint event! And it does this even if the panel is being permanently shown (even with autohide disabled), which is way overkill for a patch which fixes flicker while the autohiding animation is being shown. I guess there's a missing conditional there to check for whether we're actually running the animation at this point before resetting the background to transparent.
Comment 1 Aaron J. Seigo 2008-10-18 22:20:09 UTC
this was fixed in trunk shortly after it was committed ...
Comment 2 Kevin Kofler 2008-10-18 22:55:29 UTC
And the fix was? None of the patches which went into the file that patch touches after that revision appear to be addressing this.
Comment 3 Aaron J. Seigo 2008-10-18 23:06:34 UTC
the fix was to not set the bitmap mask on each repaint. i believe it was Marco Martin who found and fixed the issue, we could probably ask him.

<placeholder for the "this is why backporting unfinished work from trunk is a bad idea" speech>
Comment 4 Kevin Kofler 2008-10-18 23:15:00 UTC
This one?
http://websvn.kde.org/?view=rev&revision=866998
I didn't think that's related, but I must have been mistaken (as trunk doesn't eat CPU that way), I'll give that patch a try (also reenabling the anti-flicker patch which I disabled in the backport because of this issue).
Comment 5 Kevin Kofler 2008-10-18 23:21:46 UTC
(I first didn't even find it because it was in a different file, and when I found it just a few hours ago, I thought that can't be it because it doesn't touch the same code. My mistake.)
Comment 6 Aaron J. Seigo 2008-10-18 23:28:58 UTC
yep, that's the change =)
Comment 7 Kevin Kofler 2008-10-19 03:09:57 UTC
Fixed (properly) in kdebase-workspace-4.1.2-6.fc10. (It was temporarily "fixed" in 4.1.2-5.fc10 by omitting the flicker fix. The 4.1.2-4.fc10 build with this bug was only in Rawhide for 1 day and never in F9.) Even 4.1.2-5.fc9 never even reached updates-testing, the plan is to push 4.1.2-6.fc9 there and see how it goes in testing. So don't panic, we aren't out there to break KDE. ;-)