Native Poulsbo (GMA 500) graphics driver for Fedora 10+

So, yes – today I successfully got the ‘psb’ driver from the Ubuntu Mobile repositories built and working on Fedora 10, with my Sony Vaio P.

Some new packages showed up in the Ubuntu repositories this morning, newer versions built for 9.04. So I thought I’d give it another shot on Fedora. And, with a bit of fiddling, it works. The packages build on Rawhide, too, so it should also work on Fedora 11, but I haven’t tested that yet. (I doubt video and 3D acceleration can work, as the proprietary Xpsb lump, which is some pre-built modules for X, hasn’t been released for Ubuntu 9.04 yet – it’s still only for 8.10, which is an older X server version).

Here’s the .src.rpm’s:

libdrm-poulsbo
psb-kmod
psb-firmware
xpsb-glx
xorg-x11-drv-psb

And here’s binary packages, for Fedora 10 fully updated with kernel 2.6.27.21-170.2.56.fc10.i586 (you’ll have to rebuild the psb-kmod .src.rpm for any other kernel, I can’t figure out how to make it spit out an akmod package):

libdrm-poulsbo
libdrm-poulsbo-devel (you only need that if you want to rebuild any of the other bits)
kmod-psb-2.6.27
kmod-psb
psb-firmware
xpsb-glx
xorg-x11-drv-psb

You need to download and install them all together. I haven’t bothered building a dependency chain between them or creating a metapackage to require them all, yet. It’s a bit rough and ready.

So far, 3D acceleration doesn’t work – I think because I’m missing some kind of janky rebuilt version of the Mesa DRI libraries that’s in the Ubuntu repositories. 2D video playback acceleration should be working, but I haven’t yet built the special version of mplayer that’s needed to test that. I’ll take a shot at those two (and some tidying up) tomorrow. If you’re interested, here is the Mesa DRI library stuff, and here is the patched mplayer (take note of the requirements at the bottom).

To get it going, you need to load psb on boot – it doesn’t come with any modaliases (sigh), so it doesn’t get automatically loaded – just stick ‘modprobe psb’ in /etc/rc.local . Then you need a /etc/X11/xorg.conf which specifies psb as the required driver. That should be all. UNLESS you have a Vaio P, at least by my experience. X will fail to start, with a strange error in Xorg.0.log: “could not mmap framebuffer…(operation not permitted)”. There’s another error in /var/log/messages – something like “program xorg tried to access /dev/mem between foo and bar”. The workaround for this took a bit of lateral thinking – it’s something to do with memory mapping, so…futz with the memory. Turns out that pretending you have 512MB, 1GB or 1.5GB of RAM makes it work (haven’t tried higher than that yet – the P actually has 2GB). So just add:

mem=1500MB

as a kernel parameter. And then you should be good to go.

One thing I found impressive is that the driver actually has a rather good RandR implementation. It has the no-dynamic-framebuffer-resizing limitation, so you need to add a Screen section to xorg.conf something like this:

Section “Screen”
Identifier “screen1″
Device “Videocard0″
DefaultColorDepth 24

Subsection “Display”
Depth 24
Virtual 3280 1050
EndSubsection

Subsection “Display”
Depth 16
Virtual 3280 1050
EndSubsection

Subsection “Display”
Depth 15
Virtual 3280 1050
EndSubsection

Subsection “Display”
Depth 8
Virtual 3280 1050
EndSubsection
EndSection

but once you have that, the chip is capable of driving my setup – the P’s internal 1600×768 display, and an external 20″, 1680×1050 display – side-by-side (since it’s RandR 1.2+ stuff, you can configure it with gnome-display-properties). Pretty neat. It even seems to have some level of hotplugging – when I unplugged the external display, it automatically resized everything down to the internal display, without even needing to do xrandr –auto. Nice.

This should be *fairly* easy to adapt to other distros from my .src.rpm’s, I might try and throw together Mandriva packages this weekend if I get time (have to turn the kmod package into a DKMS package). But, of course, it’s not fully F/OSS, not suitable for inclusion in the repos for F/OSS distros. Let me know how you get on with this stuff in the comments.

37 Responses

  1. Felix
    Felix May 13, 2009 at 11:02 pm | | Reply

    It will spit out an akmod as soon as you comment out
    %define buildforkernels newest

  2. Oriol Rius
    Oriol Rius May 14, 2009 at 1:25 am | | Reply

    I can not found this packages in Ubuntu Jauty repository, can you tell me where did you find it?

  3. pabr
    pabr May 14, 2009 at 6:10 am | | Reply

    I tried on a Vaio P, FC10, kernel 2.6.29.

    Gave up on solving the rpmfusion dependencies and compiled psb-kernel-source-4.40 manually with “make DRM_MODULES=psb”.

    Merely inserting psb.ko kills the text console (screen goes black with green garbage at the top). Is this normal ?

    X is terminated by oom-killer on startup, after mmap’ing a total of 45 MB from /dev/dri/card0 (according to strace).

    “Program X tried to access /dev/mem between 7f6a3000->7fea4000″ seems to be triggered by CONFIG_STRICT_DEVMEM and xf86MapVidMem(). This is puzzling – how do all the other drivers with “stolen” video memory avoid this ?

    So, still no luck for me, but thanks for all your work. After trying to match gregkh’s staging drm driver with the Ubuntu 8.10 sources I can appreciate the effort. Maybe I will downgrade to 2.6.27 later.

  4. Dell shipping revamped Ubuntu 8.04 with the Mini 10 « YC’s playground

    [...] on Linux – that was unintentional because there’s no information here. Please look at Adam Williamson’s work on a native driver for Poulsbo [...]

  5. pabr
    pabr May 14, 2009 at 9:03 am | | Reply

    adamw: Yes, WiFi works (including WPA) with vanilla 2.6.29 from kernel.org and userspace tools from FC10 updates. IIRC I set up some config files manually, but that’s mostly because I am not familiar with the redhat GUIs.

  6. pabr
    pabr May 14, 2009 at 9:40 am | | Reply

    I did apply psb-kmod_build.patch from your source rpm, and it compiled under 2.6.29 with only warnings (notably about PAT).

  7. pabr
    pabr May 16, 2009 at 9:21 am | | Reply

    OK, one problem was that my kernel had CONFIG_FRAMEBUFFER_CONSOLE disabled, and psb.ko apparently cannot coexist with a regular text console. I now have basic 2D acceleration on 2.6.27.23 with a heavily customized kernel config, thanks !
    On 2.6.29, X still triggers oom-killer on startup.

  8. pabr
    pabr May 17, 2009 at 12:11 pm | | Reply

    Hmmm, I only just discovered the xrandr/multihead fiasco:
    http://modeemi.fi/~tuomov/b/archives/2008/07/13/T18_03_06/
    I.e. recent X drivers do not support “zaphod mode” (multiple X screens) anymore. It looks like the ATI people have re-developed the functionality on top of xrandr, but the intel driver (which psb is based on) has dropped it entirely.

    This means only a few window managers will be usable with a dual-head setup on poulsbo…

  9. Bastien Nocera: Dell Mini 10, gah | Techie News

    [...] had a bit of luck getting the Poulsbo going on Fedora 10. I haven’t been so lucky under F11 yet, and the wireless card could apparently [...]

  10. pabr
    pabr May 18, 2009 at 1:18 am | | Reply

    So you tested two mainstream window managers, and only one of them supports RandR hints correctly. I would say this confirms my opinion :-) (kwin probably handles RandR now, though.)

    Needless to say, most of the lesser-known window managers support neither RandR nor Xinerama – and they didn’t need to, since X configured with multiple screens had been providing reasonable multihead functionality for about 20 years.

    Besides, nobody will bother hacking RandR support into every single WM on earth, because everybody expects RandR 1.3 to fix the problem sometime in the future. In the meantime I am stuck with clone mode.

  11. pabr
    pabr May 19, 2009 at 2:06 am | | Reply

    “[mi] EQ overflowing. The server is probably stuck in an infinite loop.”

    This happens a couple times per day with the psb driver on Fedora 10. The display freezes (except the mouse pointer) and I have to kill the X server.

    I know this error message is not specific to psb; but I never got it with the vesa driver.

  12. Poulsbo 2D Working « Tyroeternal
    Poulsbo 2D Working « Tyroeternal June 3, 2009 at 11:08 am |

    [...] These packages have also been brought over to the Fedora distribution for users of Fedora 10 and hopefully Fedora 11 as well: http://www.happyassassin.net/2009/05/13/native-poulsbo-gma-500-graphics-driver-for-fedora-10/ [...]

  13. Olivier DAVID
    Olivier DAVID June 18, 2009 at 8:17 pm | | Reply

    Adam, we tried these src.rpm on a custom poulsbo platform, and it seems to have version incompatibilities. Where can we find a complete list of versions used for your test (for xorg, xserver, mesa, kernel, …) ?

  14. reiv
    reiv June 19, 2009 at 5:03 am | | Reply

    I make my eking i1(intel atom + gma500 umpc) working including 3D acceleration(direct rendering = yes). I use everything from this post(.src.rpm) except psb_dri.so(in xpsb-glx-0.11-1.aw_fc11.src.rpm), the one I used is from
    http://netbook-remix.archive.canonical.com/ubuntu/dists/hardy-dell-mini/main/binary-lpia/libgl1-mesa-dri-psb_0.24+repack+0038.1-0netbook1_lpia.deb

    below is the list of installed packages(or files)

    + install using portage (my system is gentoo)
    - kernel: 2.6.29-gentoo-r5(build kmod from .src.rpm)
    - x11-base/xorg-server: 1.4.2
    - media-libs/mesa: 7.0.3
    - x11-libs/libdrm: 2.3.0(from .src.rpm, libdrm-poulsbo)

    + install manually(compile & copy .so to system dir)
    - xorg-x11-drv-psb: use src.rpm version, compiled against libdrm-2.3.0, xorg-server-1.4.2
    - psb_dir.so: from libgl1-mesa-dri-psb_0.24+repack+0038.1-0netbook1_lpia.deb
    - Xpsb.so, psb_drv_video.so: from xpsb-glx-0.11-1.aw_fc11.src.rpm

    PS: glxgears report the fps is about 220, is this a regular value?

  15. reiv
    reiv June 19, 2009 at 7:34 pm | | Reply

    compiz claimed “GLX_EXT_texture_from_pixmap is missing” and exit,
    but glxinfo show there is GLX_EXT_texture_from_pixmap.

  16. jeje35
    jeje35 June 21, 2009 at 11:52 pm | | Reply

    I’ve been using Fedora 10 with all your above rpm and I have a mismatch version in kernel modules. It seems the modules (drm.ko and psb.ko) are 2.6.27.21-170 version and the kernel in Fedora is 2.6.27.21-170 version. Is there a way to overpass this issue? Do I have the wrong modules version?

  17. jeje35
    jeje35 June 23, 2009 at 7:38 am | | Reply

    Hi Adam,
    Can you tell me where to find the 2.6.27.21-170.2.56.fc10.i586 rpm?
    Thanks

  18. _stalker_
    _stalker_ July 1, 2009 at 5:23 pm | | Reply

    hey guys,
    thanx adam for those packages. that’s really helpful… even though I could not get to compile them :(

    I have the dell mini 12. it was shipped with the dell customized version of ubuntu.
    reiv: glxgears gave a rate of 900…

    anyway, I wanted to blast it out and to go for gentoo (I’ve been using it for 7 years)

    1) I could not get to compile the kernel mod neither the xorg driver.
    my kernel is a 2.6.28 with the tuxonice patches (is 2.6.29 mandatory?).
    here is the error line of the compiler:
    “include/linux/mmzone.h:277: error: ‘MAX_NR_ZONES’ undeclared here”

    2) for the xorg driver:

    mm_drm.c: In function ‘bufMask’:
    mm_drm.c:207: error: ‘drmBO’ has no member named ‘mask’

    do you guys have any idea for a fix?

    reiv: you wrote you successfully compiled those. could you give some details on that? a quick how-to would be perfect :) :) :)

    thanx again for your work guys and (I hope) for your answers

  19. kushalkoolwal
    kushalkoolwal July 5, 2009 at 1:13 pm | | Reply

    Hi,

    I am trying to make the Poulsbo driver work on Debian system. Does anybody has any pointers on how to get started on this? Can I just convert the rpm packages to deb using alien and install them? I do realize that I will still need to compile the psb drm module for my existing kernel.

    Or else if I have to build all the deb packages from the source, how do I get started? I am willing to spend some time on this but I need some direction as to how to proceed. Thanks

  20. kushalkoolwal
    kushalkoolwal July 9, 2009 at 10:20 am | | Reply

    Ok, last week I tried to get the psb driver work on Debian (5.0) using your sources. I was able to build the modules successfully and during boot it seems that the psb framebuffer module is getting loaded as my screens goes off for couple of seconds from ugly console and then it comes back with crisp resolution on the console while it is still booting.

    However, as soon as my Xserver starts I get the following error message in my Xorg log file:

    xf86MapVidMem: Could not mmap framebuffer (0×00000000, 0xdfe80000) (Cannot allocate memory)

    I also tried the mem=1500M parameter as suggested by AdamW but as soon as the kernel tries to boot I get the following message:

    Error 28: Selected item cannot fit into memory.

    Any clues?

  21. sofauxboho
    sofauxboho July 13, 2009 at 5:23 pm | | Reply

    In Ubuntu Jaunty on my P588E setting the kernel parameter to mem=2000MB also allows the machine to boot without framebuffer errors, and also allows the use of all of the P’s memory.

    It would seem something is detecting total memory incorrectly.

    Obvious but worth noting: with the mem=1500MB kernel option, the free command obviously reports only 1.5gb of memory available while running. You’re tossing out half a gig of RAM there.

  22. g675
    g675 July 16, 2009 at 10:11 am | | Reply

    Adam, firstly I am completely new to Linux so excuse my wet behind the ears questions. I have found your blog invaluable in a number of areas the past week or two whilst I ‘learn the ropes’ having installed Ubuntu.

    Where I am still struggling, is one of your favourite subejcts; the video driver on the VAIO-P. I have followed your instructions, seen to have got the driver and packages installed operationally, however am still getting the “framebuffer” error you mention in your post.

    I have entered the mem=1500MB line, also trying different figures but it makes no difference. Same error and back to VESA.

    Any help or thoughts you can provide would be greatly appreciated. As for Ubuntu, I am loving it; it has really made the VAIO-P come alive after being tied down under Vista to a grunting, hard to use piece of kit.

    Thank you in advance,

    Gareth

  23. _stalker_
    _stalker_ July 19, 2009 at 12:16 pm | | Reply

    hi guys,
    I finally managed to compile the psb kernel modules against a 2.6.29 kernel.
    I also copied the firmware to /lib/firmware (looking at the kernel’s logs, it seems the psb kernel mod needs it at probe time).

    anyway, nothing exciting, because as soon as I modprobe the psb kern mod (I actually probe the customized drm, then psb), my console (and my X) display gets screwy. everything is condensed and repeated 3 times…
    nothing usable.

    I even tried with the more up-to-date version from the Ubuntu Mobile team (4.41.1). exact same stuff

    it seems someone posted something similar up in the thread. did anyone fix that issue?

  24. pabr
    pabr July 22, 2009 at 2:08 am | | Reply

    For what it’s worth, I now have psb running with linux-2.6.30.2 and FC10 on the Vaio P. Earlier attempts with linux-2.6.29 failed with mysterious OOM errors. This time I used sources from psb-kernel-source_4.41.1-0ubuntu1~904um1_all.deb, with straightforward fixes.

    But Xorg still hangs after a few hours: The display freezes (except the mouse pointer) and Xorg.0.log says “[mi] EQ overflowing. The server is probably stuck in an infinite loop”.

  25. stomic
    stomic July 22, 2009 at 12:57 pm | | Reply

    While trying to load psb.ko on Fedora 11 runing on IB888 Atom SBC I get a following error:

    [drm:psb_do_init] *ERROR* Gatt must be 256M aligned. This is a bug.

    Same thing with gentoo and same drivers built from source. If I comment out this check in source code, module loads successfully but board locks-up when starting X.

    Does anybody know how to solve this issue?

  26. _stalker_
    _stalker_ July 22, 2009 at 6:20 pm | | Reply

    thanks pabr
    I’ll upgrade to 2.6.30-r2 and try to stick to what you’ve done.
    thx

  27. pabr
    pabr July 30, 2009 at 8:03 am | | Reply

    Good news maybe ? With “modprobe psb no_fb=1 ignore_acpi=1″, Xorg does not freeze anymore. On the other hand, I occasionally get kernel panics (keyboard leds flashing) while waking up from standby.

You can comment without reCAPTCHA by using an OpenID as the URL, or logging in with an OpenID or an old site account.

Leave a Reply