blino's website

Free software developer and more

The "psb" Poulsbo driver from Intel was broken on X server 1.7, because of API changes notably.

But after some love, here it is, starting your X again!

First, upstream Xorg removed some stubs in server 1.7 (xfree86: Remove loader symbol list ABI stubs), and the psb driver was still calling them. Just removing the calls from the psb driver was enough about that.

The Fedora package ships a patch for server 1.7 that contains fixes about includes and libpciaccess, which I reused.

After this, it built fine, but the psb driver could not be loaded from X, because it was not linked with the internal "libmm" library, and failed finding its symbols. Building without -Wl,--as-needed made it link fine with, but it is just a workaround.

In addition, some non-existent functions like mmListEmpty() were called from the internal libmm library. Previously, this has been workarounded by passing -Wl,--no-undefined as linker flags so that the library can be linked fine, and everything was fine at runtime as long as nothing used the symbol. But now, it seems libmm can't be loaded this way by dlopen(), even with lazy binding, it complains about the undefined symbols. So, I finally fixed it the proper, by adding back -Wl,--no-undefined, and removing the code calling the non-existent functions, which was unused anyway.

It also exposed an undefined assert() symbol as well, caused by a missing assert.h include...

Then, X still failed loading because it couldn't find mmCreateDRM(), which should be in libmm. That's because we build our Xorg with "hidden" visibility. It was enough patching and fixing libmm already, so a quick fix was to build with -fvisibility=default. This also fixes the linking of with, and allows to use -Wl,--as-needed again when linking the driver.

The final touch is the make the Xpsb proprietary extension usable again. The only issue was that the empty xf86AddModuleInfo() function has been removed upstream. Adding this empty function back in psb_driver.c directly is dirty, but makes it usable again :)

As bonus, I also fixed my patch setting MigrationHeuristic option to "greedy" by default, as it seems to lower the odds of a random crash.

There are still some unrendered pixmaps issue, and segfaults when playing with libva, but at least X is starting fine now, and 3D as well as accelerated video are working :)

(in recent Mesa releases, another issue appears in the proprietary dri driver, because of _glapi_set_warning_func() removal upstream, calling for another workaround /o\)

Enjoy this in Mandriva Cooker, it's already available in our contrib packages!

Other distros, you're welcome in cherry-picking our psb patches.

zobi8225 wrote at 2010-04-27 20:14:

thx guy, You help a lot

phb wrote at 2010-04-28 21:10:

Thx blino !!! you are crazy good guy !

jbernardo wrote at 2010-04-30 07:41:

Blino, first, let me thank you for your work. Second, I need help porting your patches to ubuntu... :) I managed to add them, changed visibility, and now the problems seem to be in DRI. As you wrote there is the removal of _glapi_set_warning_func, I wondered if that might be it, and how I could fix it. Any suggestions? Here are the final lines of my Xorg.0.log, after loading the psb module, in case that helps.

jbernardo wrote at 2010-04-30 10:54:

Ok, the problem isn't _glapi_set_warning_func, I added a stub for it and the driver still won't load, with the same errors in Xorg. I have to dig deeper.

jbernardo wrote at 2010-04-30 18:49:

Still stuck.. I wonder what is so different in ubuntu that the module will load, but won't initialize dri and create /dev/dri/card0? If you have any hint at all, I'd be grateful.

mangoo wrote at 2010-05-02 01:11:

Do suspend to RAM / suspend to disk work?

jbernardo wrote at 2010-05-05 08:31:

A little status update: the problems with dri I had where because ubuntu moved libdrm to /lib, so it would always be loaded instead of libdrm-poulsbo. Now X starts, I can login (kdm), but get segfaults after some time. How stable is this driver under mandriva?

jean-michel wrote at 2010-05-05 19:33:

hello olivier we are a little team of linux users, we use teamspeak to talk together . I hope you will come to talk to us every body is also welcome even windows users :) my server address : that 's my PC working on the best distrib ... :)

jbernardo wrote at 2010-06-08 15:20:

3D is now fixed - feel free to check these two patches by Yves de Muyter: and

blino wrote at 2010-07-20 17:02:

jbernardo: thanks for the help! I'll merge the patches back in Mandriva :)

jbernardo wrote at 2010-07-21 17:56:

Blino, also please check these two patches by Yves de Muyter: exa_mixed: xv:

The exa_mixed patch is to enable 3D without crashes, the xv is to try to avoid hangs when using xv video output (it still shows a blank window).

Comments are closed for this story.

Trackbacks are closed for this story.

blosxom Optimised for standards.
Olivier Blin (2005)