Bug #254468 – momentary video garbage upon drawing new objects

This is likely going to be a bit controversial.
This bug is the result of what happens when good engineering practices are ignored.
In the xorg-server package in Intrepid, we have a patch called 107_fedora_dont_backfill_bg_none.patch. This is a hack that the author of the patch says is, “breaking protocol semantics that have been good for twenty years”. Now for some time, this was a good hack. It helps a lot with making Compiz go faster. I’m not sure how long it’s been around. The earliest I reference I found in the package’s debian/changelog was:
xorg-server (2:1.2.0-3ubuntu1) feisty; urgency=low

* dropped patches (comments from Michel Daenzer):
– 107_fedora_dont_backfill_bg_none.patch
“Breaks X semantics and thus can’t go in upstream. Apps/toolkits
need to be fixed not to use background none windows.”

— [redacted – it doesn’t really matter who uploaded it] Mon, 26 Feb 2007 09:36:38 +0100
So it’s been there at least two years. I don’t know how much longer than that.
Later it got put back because it helped with performance. Up until KDE4 appears, it’s all good. Unfortunately it appears no one ever told KDE or Qt about this and so they relied upon the established semantics of the protocol. Whenever a new object is drawn in KDE4, such as the application menu or any application whatsoever, the space in which it will be drawn is first allocated with video garbage. After a brief delay – perhaps 200ms – the garbage is properly replaced with the real object contents. This slows things down and is a major annoyance. I’ve had at least one user tell me they gave up Kubuntu because of it.
The good news is that the patch has been dropped (at least for now) in Jaunty, so there is hope for the future. I had a long discussion with some of the involved people on #ubuntu-devel yesterday about putting the same change in intrepid-updates, but lost out because dropping the patch now would be a performance regression for Compiz users in Ubuntu. For Intrepid KDE users we are going to provide alternate packages and see how it goes.
It is in the same PPA that we are using to provide experimental KDE 4.2 packages for Intrepid:
If you don’t want all of KDE 4.2, it’s also in my PPA:
Please note that PPAs are now signed. Follow the instructions to add the repository keys.
These packages are not official K(U)buntu packages. Do not file bugs against them and it’s not my fault if it does something bad to your computer (these are experimental). Let me know if you have problems though.
I’ve installed this on multiple Intel machines and got positive test reports from both Nvidia and ATI users.
So now we are stuck between a rock and a hard place between having xserver optimized for Compiz or Kwin.
I can understand why the hack was done and it looks like it’s a good idea. The real problem is that getting the protocol and documentation changes to get this upstream was not done and it wasn’t widely communicated through other means. I understand that changing the X protocol is not something to undertake lightly and a hard job to get done, but however long it takes, we’d be two years closer to being done if that work had been started at the same time the patch was written.
Hacks that solve problems are great, but you have to follow-up and do the hard engineering that gets them out of being a hack and into the way things are done.
There are more details in the actual bug.


12 Responses to “Bug #254468 – momentary video garbage upon drawing new objects”

  1. 1 Mircea January 29, 2009 at 17:11

    Thanks for doing this. Luckily for me nVidia worked around this in their driver sooner than Ubuntu started to listen. Maybe you can convince Ubuntu to provide a 32bit desktop kernel with PAE enabled. I have been unsuccessful.

  2. 2 Martin Gräßlin January 29, 2009 at 18:29

    Thanks a lot. It sounds like a really good idea to put this into the kde 4.2 repository. I am using an unpatched X for weeks.
    Btw I thought about switching the distribution because of this annoyance.

  3. 3 Giovanni Masucci January 30, 2009 at 08:37

    MMM good news..actually I’m on opensuse in my home installation because of that patch…I’ll consider returning to ubuntu if jaunty will not include the patch or if qt 4.5 includes a fix for it (corrently they are working on this issue) and jaunty includes qt 4.5

  4. 4 Aru January 30, 2009 at 11:30

    Thanks so much for rolling this into the 4.2 PPA. The garbage issue has been a major nuisance for me ever since I dropped Compiz in favor of KWin.

  5. 5 Jeroen January 31, 2009 at 03:54

    Thanks for this update. Before it KDE was way to slow on a brand new laptop. I switched to Gnome because of it. No I can finally enjoy KDE like it was meant to be.

  6. 6 Kamil February 22, 2009 at 04:50

    So, if I understand well path is available only for Jaunty. What abot Intrepid?

  7. 7 Scott Kittemran February 22, 2009 at 09:08

    @Kamil: Making this change in Intrepid, while good for Kubuntu users, would have a negative effect on Compiz users. This is not appropriate for a post release change.
    This is why I have made an updated package available through my PPA for Intrepid (see the link in the post).

  8. 8 riivo March 11, 2009 at 15:52

    i’m sorry, but how to apply this patch 😕

  9. 9 ScottK April 19, 2009 at 00:54

    @riivo: If you go to https://launchpad.net/~kitterman/+archive/ppa it gives you instructions on how to upgrade.

  10. 11 Luke Anderson May 11, 2009 at 17:53

    Or something like this should create you a new xorg package:
    # apt-get install build-essential
    # apt-get source xorg-server
    # apt-get build-dep xorg-server
    # mv 107_fedora_dont_backfill_bg_none.patch xorg-server-1.6.0/
    # cd xorg-server-1.6.0/
    # cat 107_fedora_dont_backfill_bg_none.patch | patch -p1
    # dpkg-buildpackage

  11. 12 Scott Kitterman May 11, 2009 at 23:21

    Thanks. I’m an Ubuntu core-dev and well aware of how to patch packages. My PPA (linked in the comment above yours) provides a patched version of the package for Intrepid.
    Fortunately this patch was removed for Jaunty and so as I’ve moved on, it’s no longer an issue for me.
    The main point about this post wasn’t how to work around this particular problem, but the poor engineering that got us into this mess in the first place.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: