Next Previous Contents

5. XFree86 with DRI

5.1 Preparing the kernel modules

In order to have a functionnal DRI (acceleration), you need to insert three modules in the following order: agpgart
uninorth-agp
radeon

This is achieve on Debian systems by adding these modules to /etc/modules:

Note: It is importante to use >> (append at end) instead of > (overwrite)

echo agpgart >> /etc/modules
echo uninorth-agp >> /etc/modules
echo radeon >> /etc/modules

5.2 Installation of an appropriate XFree86

You can now directly use the package provided by Debian apt-get install xserver-xfree86 xlibmesa-dri xlibmesa-gl xlibmesa-glu

(We used to install the packages provided by Michael Daenzer in a specific repository.

If you used them you should purge the following packages: xserver-xfree86-dri-trunk xlibmesa-gl1-dri-trunk.)

5.3 Important lines in /etc/X11/XF86Config-4

The device Section

Section "Device"

  ### Available Driver options are:
  Identifier      "..."         #give it a name here
  Option          "UseFBDev"    #this is mandatory
  Driver          "radeon"
  VendorName      "ATI"
  Option          "AGPMode" "4"
#  Option          "EnablePageFlip" "On"
# When I enable PageFlip it looks really weird but gives a higher FPS,
# It may work correctly when using GL in fullscreen
  BusID         "PCI:0:16:0"
EndSection

5.4 Keyboard Mapping

I saw lots of different information about this,
all the keymap shipped with your XFree will be in /usr/X11R6/lib/X11/xkb/symbols/macintosh/
I copied the folliwng keymap to /usr/X11R6/lib/X11/xkb/symbols/macintosh/fr_new:

New French keymap

fr_new

How to find the keys I need to change ?

Example:

You will probably need the pipe, also known as bar:
Open fr_new, and look for 'bar', you will get there

    key <AC09> {     [         l,    L               ],
                [   notsign,    bar             ]       };
It means that a certain key is used for l (small L) when not using modifiers, L when combined with Shift, notsign with Alt and | with Alt and Shift.

InputDevice Section in XF86Config-4

Section "InputDevice"
       Identifier      "..."
       Driver          "Keyboard"
       Option "Protocol"       "Standard"
       Option "AutoRepeat"     "250 30"
       Option "LeftAlt"        "Meta"
       Option "RightAlt"       "Meta"
       Option "ScrollLock"     "Compose"
       Option "RightCtl"       "Control"

       Option "XkbLayout"     "macintosh/fr_new"
EndSection

5.5 How to check that acceleration works with XFree ?

If the package xbase-clients is installed, you can just start glxgears.

If you see spinning gears then everything is right :]
(I get about 850 frames per second)

5.6 Using the external Video output

Building a patched XFree86

Install the package building tools:

apt-get install devscripts

Install the dependancies:

apt-get build-dep dri-trunk-sid
(Thanks mockenh)

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

deb-src http://people.debian.org/~daenzer/dri-trunk-sid/ ./

apt-get update
apt-get source xserver-xfree86-dri-trunk
cd dri-trunk-sid-*/debian/patches

Download the following patch:

XFree86 patch

(This patch was originally available thanks to Juan Pablo Mendoza, I only modified the path on the first line...)

mv radeon-new.diff 120videoout.diff
cd ../..
debuild
dpkg -i ../*.deb

XF86Config for Cloning

XF86Config with cloning

Overlays in Cloning

Only certain types of overlay will be cloned, for others, you can switch them to the external display using the XV_SWITCHCRT attribute.

I used Xvattr to switch on the fly the screen on which the overlay should be drawn using shortcuts.

To switch it to the internal LCD:
xvattr -a XV_SWITCHCRT -v 0

To switch it to the external output:
xvattr -a XV_SWITCHCRT -v 1

5.7 Using an external USB mouse

I wanted to be able to plug an USB mouse and use it right away without changing anything (Mac OS X like).

You just new to plug it provided that you support USB, you can get the wheel to work by using a similar InputDevice section:

Section "InputDevice"
                Identifier      "..."
                Driver          "mouse"
                Option          "ZAxisMapping" "4 5"    #wheel mapping
                Option          "Protocol" "IMPS/2"
                Option          "Device" "/dev/input/mice"
EndSection

5.8 Gamma correction

I thought the luminosity of the screen was too aggressive, you will probably want to fix that using:
xgamma -gamma .75

Once you have determined the gamma value you like, you should add it to /etc/X11/XF86Config-4

Section "Monitor"
        (...)
        Gamma 0.75
        (...)
EndSection

5.9 Killing X

You can always kill X by doing Ctrl + Command + Backspace


Next Previous Contents