Unfortunately enabling xinerama, my favorite hot X feature, completely disables DRI. It is possible using a dual head graphic adapter and the proprietary driver of either NVIDIA or ATI to get an accelerated xinerama screen, but since I do not own a dual head card, this is not an option.
X.org supports DRI on the primary head on non-xinerama dual-head configurations. I went with this option for a while and enjoyed some games and opengl applications, but I felt betrayed. I paid a high price (disabling xinerama) and got only one accelerated head.
The idea is to use two accelerated X instances and tie them together using x2x⇒ or synergy⇒.
For each head you need one Monitor section, one Device, one Screen and one ServerLayout section.
Your primary head requires no modification at all, for each secondary head create the following entries:
xorg.conf
Section "Monitor" Identifier "MonitorX" VendorName "Apple" ModelName "whatever" EndSection Section "Device" Driver "tdfx" VendorName "3Dfx Interactive, Inc." BoardName "Voodoo 3" BusID "PCI:0:11:0" EndSection Section "Screen" Identifier "ScreenX" Device "CardX" Monitor "MonitorX" DefaultDepth 16 SubSection "Display" Depth 16 Modes "1024x768" "800x600" "640x480" EndSubSection EndSection Section "ServerLayout" Identifier "seatX" Screen 0 "ScreenX" 0 0 InputDevice "VoidKeyboard" InputDevice "VoidPointer" EndSectionYou also need to define one void keyboard and one void pointing device:
void events
Section "InputDevice" Identifier "VoidKeyboard" Driver "void" Option "CoreKeyboard" EndSection Section "InputDevice" Identifier "VoidPointer" Driver "void" Option "CorePointer" EndSectionUsing this void keyboard definition I encountered a strange thing. The second head was not receiving certain key scan-codes (I confirmed this using xev). In fact, the only keys working were the alphanumeric keys, space, escape, full stop etc. but things like ctrl, shift and return were missing. This might be a bug in X.org, not sure though. I ended up plugging a spare usb keyboard in and using this as void keyboard:
my spare keyboard
Section "InputDevice" Identifier "VoidKeyboard" Driver "evdev" Option "Device" "/dev/input/event3" Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc104" Option "XkbLayout" "us" Option "XkbOptions" "ctrl:nocaps" EndSection
Start your heads in turn using the command
X -novtswitch -sharevts -layout seatN :0Okay, your display is scrambled, your keyboard is useless, but all screens are working now and you are still with me? Great!
startxms
#!/bin/sh
# startx is nicer, as it creates .Xauthority entries for us, but unfortunately
# its not working for me
COMMAND=xinit
# unfortunately I have to run this script as root, otherwise X bails out
# something about no permissions, which is funny, because X is set{u,g}id root
# so I just start this as root and su to the target user
USER=teythoon
# read about my glx adventures in the next chapter
switchGLX nvidia
$COMMAND /bin/su ${USER} -c /bin/sh /home/${USER}/.xinitrc.0 -- -config
xorg.conf.multiseat -novtswitch -sharevts -layout seat0 :0 &
# give it some time to start and switch back to xorg
sleep 10
switchGLX xorg
$COMMAND /bin/su ${USER} -c /bin/sh /home/${USER}/.xinitrc.1 -- -config
xorg.conf.multiseat -novtswitch -sharevts -layout seat1 :1
Okay, what's going on? Essential we just run the X server and ~/.xinitrc.X as
client. lets take a look at them.
.xinitrc.0
# this sets up head #0
export DISPLAY=:0
synergys --config ~/.synergy
# glx magic, see below
export LD_LIBRARY_PATH=/usr/lib.nvidia:${LD_LIBRARY_PATH}
# user specific stuff goes here
xscreensaver -no-splash &
# just start the normal xinitrc
. ~/.xinitrc
and
.xinitrc.1
# this sets up head #1 export DISPLAY=:1 synergyc --name second localhost # user specific stuff goes here # xscreensaver, conky and a windowmanager xscreensaver -no-splash & conky -d enlightenmentYou might want to remove the suid or sgid flag from your terminal to prevent it from clearing the LD_LIBRARY_PATH variable.
As you can see I am using synergy. x2x is even easier to set up, but it has fewer features (ie no screensaver synchronisation which is kind of interesting for this kind of setup).
Synergy also needs a small config file (europa is my hostname):
.synergy
section: screens
europa:
second:
end
section: links
second:
right = europa
europa:
left = second
end
Keep on reading, you are really close now...
My primary graphic adapter is a NVIDIA Geforce2 card, direct rendering is provided by NVIDIA's proprietary driver. Unfortunatly they also provide their own GLX extension for X and their own GLX client libraries.
switchGLX
#!/bin/bash cd /usr/lib/xorg/modules/extensions rm libglx.so ln -s libglx.so.Using this script and the startxms script above I start first the X server with the NVIDIA extension, switch to X.org and start the next one.
If there is a more elegant way to tell X which extensions to use please let me know.
Extending the X.org code to allow DRI on multiple heads would be the way to go. The ultimate goal is DRI accelerated xinerama, so if you got some time to waste, head over to X.org and start hacking :).