Xinerama - Multi-screens

Xinerama - Multi-screens

linux-logo

With SAX2 (Linux 7.2) it is easy to configure a single screen - however, having two screens on one machine and (in the following example) on one graphics card, is not so easy.

I have searched for days for information on the internet (mainly with www.google.com and groups.google.com) and finally I found a promising post in mailing.kde.general from Darrell Esau... So I wrote directly to him, telling him my situation. What he responded to me touched me quite a bit:

"The beauty of Linux and the open source movement is that at some stage, everyone will need the help of someone else, and therefore those people will generally not hesitate to help others when asked.
Don't worry about asking for help... especially after you've been vexed with a particular problem for days.
Now.. as for dual-screen..."

This is exactly what I appreciate most on Linux: everybody helps each other without first asking for a software support contract! This is also my motivation to somehow pay back to the community by continuing to write my findings in the web-pages under http://www.seismo.ethz.ch/linux - hopefully they are of value to some of you.

Now back to the dual-screens problem...

Well, the help of Darrell Esau did not immediately solve my problem, but his suggestions and the example of his XF86Config file pointed me on the very right track to solve the problem!

First: my software...
- SuSE Linux 7.2
- XFree86 Version 4.0.3
- KDE 2.1.2

If you have two screens connected to your PC, with e.g. a Matrox G450 DH card, you should first setup things with one screen only. Then use SAX2 and add an additional graphics card (also you have only one, but with two outlets such as the G450) and also define the second monitor and define the color and resolution stuff. However, any attempt to *test* the settings never worked on my system.
Instead, I recommend, then to edit the file /etc/X11/XF86Config (as root) and to set it up similar to the one I include below.
Please note, that since I have two identical monitors, it would not be necessary to define the second one. However, I have just copied the 'modelines' stuff from the first to the second moitor to the "Section Modes" .
Important is also, that you give the BusID from your graphics card - SAX2 did in my case just say something like 'Single'. I did then use (as root) the command 'lspci' , which showed me the BusID of the graphics card:
01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 82)
So, I added the following line to the file XF86Config in the 'Section Device':
BusID "PCI:01:00:0"
Please note, that it was necessary to include a colon ':' between the word 'PCI' and the '01' - this is different from what is displayed in the book 'Reference' from SuSE !
Below I include my new file XF86Config - configured for xinerama, which I prefer to the non-xinerama version, where you have to explicitly define the new display for each window, by defining export DISPLAY=:0.1 before you start a new window on the second screen. You may activate xinerama simply by adding a line as described below under the "ServerLayout" Section at the line
Option "Xinerama" "on"

Ok, here is my file /etc/X11/XF86Config

#--------#
# »» SaX generated XFree86 config file ««
# Created on: 2001-07-05.
#
# Version: 4.3
# Contact: Marcus Schaefer , 2001
#
# Automatically generated by SaX2 (4.3)
# PLEASE DO NOT EDIT THIS FILE!
#

Section "Files"
  FontPath  	"/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
  FontPath  	"/usr/X11R6/lib/X11/fonts/local"
  FontPath  	"/usr/X11R6/lib/X11/fonts/misc:unscaled"
  FontPath  	"/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
  FontPath  	"/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
  FontPath  	"/usr/X11R6/lib/X11/fonts/Type1"
  FontPath  	"/usr/X11R6/lib/X11/fonts/URW"
  FontPath  	"/usr/X11R6/lib/X11/fonts/Speedo"
  FontPath  	"/usr/X11R6/lib/X11/fonts/75dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/100dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/PEX"
  FontPath  	"/usr/X11R6/lib/X11/fonts/cyrillic"
  FontPath  	"/usr/X11R6/lib/X11/fonts/latin2/misc"
  FontPath  	"/usr/X11R6/lib/X11/fonts/latin2/75dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/latin2/100dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/latin2/Type1"
  FontPath  	"/usr/X11R6/lib/X11/fonts/latin7/75dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/kwintv"
  FontPath  	"/usr/X11R6/lib/X11/fonts/truetype"
  FontPath  	"/usr/X11R6/lib/X11/fonts/uni"
  FontPath  	"/usr/X11R6/lib/X11/fonts/ucs/misc"
  FontPath  	"/usr/X11R6/lib/X11/fonts/ucs/75dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/ucs/100dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/hellas/misc"
  FontPath  	"/usr/X11R6/lib/X11/fonts/hellas/75dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/hellas/100dpi"
  FontPath  	"/usr/X11R6/lib/X11/fonts/hellas/Type1"
  FontPath  	"/usr/X11R6/lib/X11/fonts/japanese"
  FontPath  	"/usr/X11R6/lib/X11/fonts/baekmuk"
  FontPath  	"/usr/X11R6/lib/X11/fonts/CID"
  FontPath  	"/usr/X11R6/lib/X11/fonts/xtest"
  ModulePath  	"/usr/X11R6/lib/modules"
  RgbPath  	"/usr/X11R6/lib/X11/rgb"
EndSection

Section "ServerFlags"
EndSection

Section "Module"
  Load  	"type1"
  Load  	"speedo"
  Load  	"extmod"
  Load  	"freetype"
EndSection

Section "InputDevice"
  Driver  	"keyboard"
  Identifier  	"Keyboard[0]"
  Option 	"Protocol"  	"Standard"
  Option 	"XkbKeyCodes"  	"xfree86"
  Option 	"XkbLayout"  	"de_CH"
  Option 	"XkbModel"  	"pc104"
  Option 	"XkbRules"  	"xfree86"
  Option 	"XkbVariant"  	"nodeadkeys"
EndSection


Section "InputDevice"
  Driver  	"mouse"
  Identifier  	"Mouse[1]"
  Option 	"ButtonNumber"  	"5"
  Option 	"Device"  	"/dev/psaux"
  Option 	"InputFashion"  	"Mouse"
  Option 	"Name"  	"AutoDetected"
  Option 	"Protocol"  	"imps/2"
  Option 	"Vendor"  	"AutoDetected"
  Option 	"ZAxisMapping"  	"4 5"
EndSection


Section "Monitor"
  HorizSync  	30-82
  Identifier  	"Monitor[0]"
  ModelName  	"PANAFLAT LC90S (TX-D9L51F)"
  VendorName  	"PANASONIC"
  VertRefresh  	50-77
  UseModes  	"Modes[0]"
EndSection

Section "Monitor"
  HorizSync  	30-82
  Identifier  	"Monitor[1]"
  ModelName  	"PANAFLAT LC90S (TX-D9L51F)"
  VendorName  	"PANASONIC"
  VertRefresh  	50-77
  UseModes  	"Modes[1]"
EndSection


Section "Modes"
  Identifier 	"Modes[0]"
  Modeline 	"800x600" 43.68 800 816 928 1072 600 600 606 626
  Modeline 	"640x480" 27.96 640 656 720 864 480 480 485 501
EndSection

Section "Modes"
  Identifier 	"Modes[1]"
  Modeline 	"800x600" 43.68 800 816 928 1072 600 600 606 626
  Modeline 	"640x480" 27.96 640 656 720 864 480 480 485 501
EndSection


Section "Screen"
  DefaultDepth	16
  SubSection "Display"
    Depth	16
    Modes  	"1280x1024" "1280x960" "800x600" "640x480" 
  EndSubSection
  Device  	"Device[0]"
  Identifier  	"Screen[0]"
  Monitor  	"Monitor[0]"
EndSection

Section "Screen"
  DefaultDepth	16
  SubSection "Display"
    Depth	16
    Modes  	"1280x1024" "1280x960" "800x600" "640x480" 
  EndSubSection
  SubSection "Display"
    Depth	8
    Modes  	"640x480" 
  EndSubSection
  Device  	"Device[1]"
  Identifier  	"Screen[1]"
  Monitor  	"Monitor[1]"
EndSection


Section "Device"
  BoardName  	"MGA G450"
  BusID         "PCI:01:00:0"
  Driver  	"mga"
  Identifier  	"Device[0]"
  Screen  	0
  VendorName  	"Matrox"
EndSection

Section "Device"
  BoardName  	"MGA G450"
  BusID         "PCI:01:00:0"
  Driver  	"mga"
  Identifier  	"Device[1]"
  Screen  	1
  VendorName  	"Matrox"
EndSection


Section "ServerLayout"
  Identifier  	"Layout[all]"
  InputDevice	"Keyboard[0]" 	"CoreKeyboard"
  InputDevice	"Mouse[1]" 	"CorePointer"
  Option 	"Clone" 	"off"
  Option 	"Xinerama" 	"on"
  Screen	"Screen[0]" LeftOf "Screen[1]"
  Screen	"Screen[1]"
EndSection

Section "DRI"
  Group  	"video"
  Mode   	0660
EndSection


Last Update: 05Jul2001 uk