Taming the three headed monster…

… or running Fedora 14 with a triple head nouveau setup and Xinerama.

For quite some time I am using my computer with two graphic cards and three Samsung panels attached to it. While I don’t like closed source drivers I had been using the Nvidia Linux driver to allow myself to run a Xinerama setup till about ~ two years ago. This kind of setup really supports my workflow and while I was writing my Bachelor and Master thesis this saved me a lot of hassle…

Somewhere down the line the nvidia driver stopped working reliably for my needs. This was also the time nouveau came around to actually being useful on ‘standard’ setups. After some KMS problems I managed to get nouveau to work.

However, considering that I have two 19” and a 20” wide-screen panel, which I had placed with the 20” panel in the middle, nouveau could not deliver me with a full working setup.

For the past 1 ½ – 2 years I have been running nouveau quite stable with the 20” on the left connected to the first graphic card and both 19” connected to the second card. Since I have two identical GeForce 9600GT, nouveau had no problems to cold boot the second card. My setup gave me two displays, one for each card.

I was quite happy with this, being an open source setup and working reliably after upgrades. However, not being able to move windows between panels,  in this case between the 20” and both 19”, was bugging me a lot. Xinerama did not want to work for me on this setup as the rightmost 19” would somehow act as showing the whole screen of both 19” like a virtual screen.

Since Xinerama is deprecated and randr does not include this kind of functionality (yet) my hope was gone to ever see this working.

Around came a weekend at the beginning of November when I desperately wanted to get a three head Xinerama setup again. This commit from Ben Skeggs in the nouveau git cought my attention: Finally Zaphod mode for nouveau.

How does this help my problem? Well with this nice and surprisingly small patch you will be able to define a separate screen (in the X sense) for echo input group. For me this means I am able to define an X screen for each panel I have attached. After compiling libdrm, nouveau and mesa from git (20101107) I was able to get three randr powered X screens. As some tests showed that they were running very stable I dared to turn on the Xinerama flag. Sadly this amounted in a nice little segfault and with a full workweek ahead I put my attention to other things again.

Next weekend around I wanted to get this done so I attached gdb to my X session and started to debug just to find out that the crash had already been fixed in a recent X build:

* Tue Nov 09 2010 Adam Jackson <ajax@redhat.com> 1.9.1-3
- xserver-1.9.1-pxtc-crash.patch: Fix crash with Xinerama enabled

I have to say that I had been running F14/rawhide since shortly after the release of F13 on this machine to test my packages etc.

I got really excited about it and after rpm finished I was really anxious to see the results. And really: The three headed monster was finally tamed again. My triple head Xinerama setup was working with nouveau. Even after placing the 20” panel in the middle spot again triple head worked across all three panels reliably.

It has not crashed once for me since and the best part of this is: Once F15 is released or an upgraded nouveau hits F14 this will be available for all Fedora users out of the box. Thank you Ben!

If you want to try it out here is my xorg.conf:

Section "ServerLayout"
Identifier     "layout"
Screen         "screen2" 0 0
Screen         "screen1" Rightof "screen2"
Screen         "screen3" Rightof "screen1"
EndSection

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

Section "Monitor"
Identifier   "monitor1"
EndSection

Section "Monitor"
Identifier   "monitor2"
EndSection

Section "Monitor"
Identifier   "monitor3"
EndSection

Section "Device"
Identifier "card1-1"
Driver      "nouveau"
Option     "monitor-DVI-I-1" "monitor1"
BusID       "2:0:0"
EndSection

Section "Device"
Identifier  "card2-1"
Driver      "nouveau"
Option        "monitor-DVI-I-3" "monitor2"
BusID       "3:0:0"
Screen      0
Option         "ZaphodHeads" "DVI-I-3"
EndSection

Section "Device"
Identifier  "card2-2"
Driver      "nouveau"
Option        "monitor-DVI-I-4" "monitor3"
BusID       "3:0:0"
Screen      1
Option         "ZaphodHeads" "DVI-I-4"
EndSection

Section "Screen"
Identifier "screen1"
Device     "card1-1"
Monitor    "monitor1"
EndSection

Section "Screen"
Identifier "screen2"
Device     "card2-1"
Monitor    "monitor2"
EndSection

Section "Screen"
Identifier "screen3"
Device     "card2-2"
Monitor    "monitor3"
EndSection

Section "Extensions"
Option        "Composite" "Enable"
EndSection