Purpose: Finally here is a step-by-step guide to get the Intel Poulsbo (PSB) GMA 500 graphics driver working under Debian testing/unstable. Over the last 3 months or so since I wrote an introductory post regarding this whole issue, I have got several emails and comments with a request to put up such a guide. Sorry I could not do this earlier because of work. Recently the work has just got a lot busier. I know, by looking at the length of the post you might get discouraged or scared and decide not to embark on this journey, but trust me and follow with me and you will be there. Towards the end of this post I have a link from where you can download all the packages and file required to get the driver working. In any case here it is…

Disclaimer

As I may or may not have noted in my previous post, I don’t claim this to be the perfect method. In fact this is not a perfect method as we have to overwrite some files later in the installation process. I bet Debian Developers will never accept such a kind of workaround. So please use this method at your own risk. This is for folks who don’t care about right or wrong method as long as they can get a native driver for their GMA 500 graphics controller on their Intel Atom notebooks. You have been WARNED!!!

Setup Environment

Kernel: 2.6.30-2-686

Debian: Testing (Squeeze)

We need two components namely the “kernel” and the “Xorg” component to get Poulsbo (psb) driver working in Debian testing/unstable. Also make sure that you just have one and only kernel installed. The reason is that if you have multiple kernel installed you might have trouble generating the kernel components.

Step 1:  Add Jaunty Ubuntu Mobile sources

Add the following line to your /etc/apt/sources.list file:

deb-src http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main

Save and quit file.

Update repositories with the new sources:

# apt-get update

Alternatively you can get the packages from here.

Step 2: Prepare your system

We need to make sure that we have kernel header files and some other development packages installed for the currently running kernel:

# apt-get install devscripts dkms module-assistant dpatch autotools-dev quilt libx11-dev pkg-config xserver-xorg-dev x11proto-gl-dev x11proto-video-dev libgl1-mesa-dev libxvmc-dev x11proto-core-dev x11proto-fonts-dev x11proto-randr-dev x11proto-render-dev x11proto-xinerama-dev x11proto-xf86dri-dev x11proto-xf86dga-dev x11proto-xf86misc-dev libxfixes-dev libxdamage-dev libexpat1-dev
# m-a prepare

Update: If you are using Debian Stable (Lenny), you need to download the package from Debian Testing and then install it on Debian Stable. The package installs just fine without complaining about any incompatibility or missing libraries.

Step 3: Install PSB source packages (Kernel Component)

In this Step we will just see how to build kernel components for the PSB driver, psb.ko and drm.ko:

# cd; mkdir -p psb/drm; cd psb/drm
# apt-get source psb-kernel-source
# cd psb-kernel-source-4.41.1

We will be taking care of any modification that are supplied in the debian/control file. If you really want to see what I am saying then please refer to Adam’s git repository. Many thanks to him!

Now before you can build kernel components you need to edit the following files:

drm_os_linux.h
drm_fops.c
drm_sysfs.c
psb_i2c.c
debian/control
debian/rules

You can download the above six modified files from here and overwrite the original files in the psb-kernel-source-4.41.1 directory. If you want to see the changes then refer to the git repository above. I could have setup my own git repository here but I am having trouble setting up gitweb on my bluehost domain account. If I ever get a chance to resolve it, I will setup the git repository and highlight all the changes.

Now we are ready to compile the kernel modules:

# debuild -i -us -uc -d -b

If the compilation went without any fatal errors then the following packages will be created:

# ls -l ../psb-*.deb
-rw-r--r-- 1 root root  90422 2009-10-27 17:42 ../psb-kernel-headers_4.41.1-1squeeze1_all.deb
-rw-r--r-- 1 root root 402272 2009-10-27 17:42 ../psb-kernel-source_4.41.1-1squeeze1_all.deb
-rw-r--r-- 1 root root 156944 2009-10-27 17:41 ../psb-modules_4.41.1-1squeeze1_i386.deb
# cd ..

Let’s install the following packages:
# dpkg -i psb-kernel-headers_4.41.1-1squeeze1_all.deb psb-modules_4.41.1-1squeeze1_i386.deb

Your kernel modules, psb.ko and drm.ko, will be installed automatically at the following location:

# ls -l /lib/modules/2.6.30-2-686/updates/char/drm
total 392
-rw-r--r-- 1 root root 207207 2009-11-04 02:07 drm.ko
-rw-r--r-- 1 root root 180389 2009-11-04 02:07 psb.ko

Now just copy these modules to their proper locations so that they can get loaded during boot time:

Updated:

# cd /lib/modules/2.6.30-1-686/kernel/drivers/gpu/drm/
# cp drm.ko drm.ko.orig
# cd /lib/modules/2.6.30-1-686/updates/char/drm
# cp psb.ko drm.ko /lib/modules/2.6.30-1-686/kernel/drivers/gpu/drm/
# depmod -ae

You may add the modules to your /etc/modules so that they load early in the boot process.

# nano /etc/modules
drm
psb

Save and quit the file.

Congratulations! You have successfully installed the kernel module You are one step closer to bliss. :-)

Step 4: Install source packages (XOrg Component)

So our next job is to install XOrg components, psb_drv.so and other related files.. In this step we are going to compile a lot of packages. Create a separate directory for xorg stuff:

# cd; mkdir -p psb/xorg; cd psb/xorg

Then download these source packages:

# apt-get source libdrm-poulsbo libva psb-firmware psb-meta xpsb-glx xserver-xorg-video-psb

Step 4(a): Compile libdrm-poulsbo package

# cd libdrm-poulsbo-2.3.0
# nano debian/control

and comment the following lines as shown in blue:

Architecture: any
#Conflicts: libdrm-dev
#Replaces: libdrm-dev

Depends: libdrm-poulsbo1 (= ${binary:Version})
......
Depends: ${shlibs:Depends}, ${misc:Depends}
#Conflicts: libdrm2
#Replaces: libdrm2

and build the package:

# debuild -i -us -uc -d -b

This will results into the following packages being created:

# ls -l ../libdrm-poulsbo*.deb
-rw-r--r-- 1 root root 18420 2009-10-27 15:20 ../libdrm-poulsbo1_2.3.0-1squeeze1_i386.deb
-rw-r--r-- 1 root root 34168 2009-10-27 15:20 ../libdrm-poulsbo1-dbg_2.3.0-1squeeze1_i386.deb
-rw-r--r-- 1 root root 24786 2009-10-27 15:20 ../libdrm-poulsbo-dev_2.3.0-1squeeze1_i386.deb
# cd ..

Step 4(b): Compile psb-firmware package
# cd psb-firmware-0.30
# debuild -i -us -uc -d -b
# ls -l ../psb*.deb
-rw-r--r-- 1 root root 11260 2009-10-27 15:00 ../psb-firmware_0.30-1squeeze1_all.deb
# cd ..

Step 4(c): Compile psb-meta package

# cd psb-meta-1.1/
# debuild -i -us -uc -d -b
# ls -l ../poulsbo*.deb
-rw-r--r-- 1 root root 1736 2009-10-27 15:06 ../poulsbo-driver-2d_1.1-1squeeze1_all.deb
-rw-r--r-- 1 root root 1750 2009-10-27 15:06 ../poulsbo-driver-3d_1.1-1squeeze1_all.deb
# cd ..

Step 4(d): Compile libva package

Before we compile this package we need to install the following packages that we just built above:

# dpkg -i --force-overwrite libdrm-poulsbo*.deb
# cd libva-0.29/
# debuild -i -us -uc -d -b
# ls -l ../libva*.deb
-rw-r--r-- 1 root root 11876 2009-10-27 15:15 ../libva1_0.29-1squeeze1_i386.deb
-rw-r--r-- 1 root root 29318 2009-10-27 15:15 ../libva-dev_0.29-1squeeze1_i386.deb
# cd ..

Note: If the above force-overwrite command does not work then try the following:

# dpkg -i –force-overwrite libdrm-poulsbo*.deb psb-firmware_0.30-1squeeze1_all.deb

Thanks Jon_J.

Step 4(e): Compile lxpsb-glx package

Before we compile this package we need to install the following packages that we just built above:

# dpkg -i libva*.deb
# cd xpsb-glx-0.18
# debuild -i -us -uc -d -b
# ls -l ../xpsb-glx*.deb
-rw-r--r-- 1 root root 1191406 2009-10-27 16:11 ../xpsb-glx_0.18-1squeeze1_i386.deb
# cd ..

Step 4(f): Compile xserver-xorg-video-psb package


# cd xserver-xorg-video-psb-0.31.0
# debuild -i -us -uc -d -b
# ls -l ../xserver-xorg-video-psb*.deb
-rw-r--r-- 1 root root 83848 2009-10-27 17:48 ../xserver-xorg-video-psb_0.31.0-1squeeze1_i386.deb
# cd ..

Now we will install the rest of the packages that we have built so far:

# dpkg -i poulsbo-driver-*.deb xserver-xorg-video-psb_0.31.0-1squeeze1_i386.deb xpsb-*.deb libva*.deb

Congratulations once again if you have come so far and all your packages were being built and installed successfully.

To cross-check if you have compiled and installed all the packages successfully here is the list:

# dpkg -l | grep squeeze1
ii  libdrm-poulsbo-dev                          2.3.0-1squeeze1                 Userspace interface to kernel DRM services -- developme
ii  libdrm-poulsbo1                             2.3.0-1squeeze1                 Userspace interface to kernel DRM services -- runtime
ii  libdrm-poulsbo1-dbg                         2.3.0-1squeeze1                 Userspace interface to kernel DRM services -- debugging
ii  libva-dev                                   0.29-1squeeze1                  Video Acceleration (VA) API for Linux -- development fi
ii  libva1                                      0.29-1squeeze1                  Video Acceleration (VA) API for Linux -- runtime
ii  poulsbo-driver-2d                           1.1-1squeeze1                   Metapackage for the 2D Poulsbo (psb) X11 driver.
ii  poulsbo-driver-3d                           1.1-1squeeze1                   Metapackage for the 3D Poulsbo (psb) X11 driver.
ii  psb-firmware                                0.30-1squeeze1                  Binary firmware for the Poulsbo (psb) 3D X11 driver
ii  psb-kernel-headers                          4.41.1-1squeeze1                Kernel module headers for the Poulsbo (psb) 2D X11 driv
ii  psb-modules                                 4.41.1-1squeeze1                Kernel module built for -686 kernel
ii  xpsb-glx                                    0.18-1squeeze1                  X11 drivers for Poulsbo (psb) 3D acceleration
ii  xserver-xorg-video-psb                      0.31.0-1squeeze1                X.Org X server -- Intel Poulsbo (2D)

At this stage you should have all the above packages installed.

Step 5: Add Symlinks

Now we need to do some “dirty” hack in order to make this driver work:

# rm /usr/lib/libdrm.so.2.4.0
# ln -s /usr/lib/libdrm.so.2.3.0 /lib/libdrm.so.2
# ln -s /usr/lib/libdrm.so.2.3.0 /lib/

Step 6: Copy xorg.conf

Finally you will need a valid xorg.conf file to make the driver work. You can download my working xorg.conf file from here.

# cp xorg.conf /user/X11/xorg.conf

One important thing to verify is that the following line is un-commented in the xorg.conf file:

Option     "IgnoreACPI"             "1"

otherwise you will see a blank/black display when the system boots.

Step 7: Reboot!

Finally reboot your system and cross your fingers. Did you see your GDM or KDM screen? If yes, then chances are that the psb driver has worked. Congratulations once again. Your hard work paid off.

Step 8: Verify

Here are some steps to verify if your psb drivers is actually loaded or not.

To check for the kernel component (drm.ko and psb.ko):

# dmesg | grep drm

Output:

[    9.762315] [drm] Initialized drm 1.1.0 20060810
[    9.824743] [drm] psb - 5.0.1.0046
.........................................
[   12.207384] [drm] intel_lvds_set_backlight: the level is 100
[   12.207391] [drm] LVDSGetPWMMaxBacklight: the max_pwm_blc is 31250.
[   12.207402] [drm] fb0: psbfb frame buffer device
[   12.207412] [drm] intel_lvds_prepare
[   12.207417] [drm] intel_lvds_set_power: 0
[   12.207422] [drm] intel_lvds_set_backlight: the level is 0
[   12.207428] [drm] LVDSGetPWMMaxBacklight: the max_pwm_blc is 31250.
[   12.268109] [drm] LVDS: set mode 1024x768 4
[   12.268169] [drm] intel_lvds_commit

I haven’t verified yet, but I think this driver uses the new KMS feature.

To check if the XOrg driver, psb, has been loaded or not:

# cat /var/log/Xorg.0.log | grep driver
Output:
(WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
X.Org XInput driver : 4.0
(II) Loading /usr/lib/xorg/modules/drivers//psb_drv.so
(II) PSB: driver for Intel GMA500 chipsets: Intel GMA500
(II) Loading /usr/lib/xorg/modules/drivers//Xpsb.so
(II) PSB(0): [Xpsb] Disable hog plug daemon in PSB driver.
ABI class: X.Org XInput driver, version 4.0

Lastly if you are lazy and don’t want to go through this entire process then you can download all the packages and files from here.

Update: I have uploaded the kernel config file, at the above link, that I used to compile these packages.

That’s it guys. Have fun.

Would really appreciate if you can report success or failure on your system. Feel free to point out any improvements and errors. I would really to make this as easy as possible. So if you know a better method for steps please chip in.

Happy PSB’ing!
Lear about the latest technology with testking 642-902 course! pass your certification exam with highest score using testking 70-640 questions and testking 646-204 practice test.

Be Sociable, Share!