Page 1 of 1

Ubuntu: i915 & direct rendering (Thinkpad X41)

Posted: Fri Nov 16, 2007 11:45 am
by ^rooker
After installing Ubuntu Edgy on my Lenovo/IBM Thinkpad X41 I realized that I didn't have graphic acceleration enabled by default. hm.

I'll try to provide a short HowTo:

1) Check if you really have an Intel i915 graphics card:
- Open a terminal and enter:

Code: Select all

lspci | grep VGA
This should return something like:
00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)
2) Check if your setup isn't already using direct rendering:
- Open a terminal and enter:

Code: Select all

glxinfo | grep direct
This should return something like
direct rendering: No
OpenGL renderer string: Mesa GLX Indirect
So, if you have an i915 based card and "direct rendering: no", proceed with this HowTo.

3) Load the necessary kernel modules:
Since xorg uses the i810 driver for i915 cards, the kernel modules for both cards should be loaded:

Code: Select all

sudo modprobe i810
sudo modprobe i915
If that worked without any errormessage, you can take a look at "dmesg" output, by typing "dmesg" in a terminal. Mine had the following lines after inserting these modules:
[17180674.800000] [drm] Initialized drm 1.0.1 20051102
[17180678.224000] ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 177
[17180678.224000] [drm] Initialized i915 1.5.0 20060119 on minor 0
- Now you must tell your system to load these modules automatically on startup. For that, simply edit the file /etc/modules and add the 2 drivers. Here's an example of what it could look like afterwards:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

lp
fuse
i810
i915
4) Modify your xorg.conf.
Here are the important parts within xorg.conf:

Code: Select all

Section "DRI"
        Group   0
        Mode    0666
EndSection

Here you can see that I'm actually using the i810 driver for my i915 card, but the more important lines are "NoAccel=false" and "DRI=true". Furthermore, I've read that you must assign a certain amount of VideoRam to these cards in order for direct rendering to work.
(For i810 cards it's >= 16MB)

Code: Select all

Section "Device"
        Identifier      "Intel LCD"
        Driver          "i810"
        Option          "NoAccel"       "false"
        Option          "DRI"           "true"
        BusID           "PCI:0:2:0"
        VideoRam        65536
EndSection
On many websites I've read that the i810 could not enable direct rendering when using more than 16bit colors - however, that doesn't seem to be of any concern with an i915 card, so I left my setup at 24bits:

Code: Select all

Section "Screen"
        Identifier      "Default Screen"
        Device          "Intel LCD"
        Monitor         "Monitor1"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1024x768" "800x600" "640x480"
        EndSubSection
EndSection
It's also important that the right modules are loaded:

Code: Select all

Section "Module"
        Load    "i2c"
        Load    "bitmap"
        Load    "ddc"
        Load    "glx"
        Load    "dri"
        Load    "extmod"
        Load    "freetype"
        Load    "int10"
        Load    "type1"
        Load    "vbe"
EndSection
5) Restart your X-server and test if it worked.
- You can simply restart your x-server by pressing "Ctrl + Alt + Backspace"
- Log in again, open a terminal and check glxinfo again:

Code: Select all

glxinfo | grep direct
On my system that returns a warning, but it doesn't seem to have any negative effect:
libGL warning: 3D driver claims to not support visual 0x5b
direct rendering: Yes
Important is the line "direct rendering: Yes".

Notes
a) i915 & Xinerama = "direct rendering: No"
On my notebook, I've had my system configured to use the VGA out to connect a second monitor and use it in Xinerama mode. Unfortunately, I had to deactivate Xinerama (and thus my 2nd screen), because otherwise direct rendering could not be enabled. I simply commented the Xinerama option out in my config:

Code: Select all

Section "ServerFlags"
        #Option "Xinerama" "true"
EndSection

Literature sources
As usual, I couldn't have done this without information from others. Here are my sources:

dri & openGL mit dem i915 (german)
http://gentoo-wiki.com/index.php?title= ... did=119204