Gentoo Wiki ArchivesGentoo Wiki

HOWTO_Dual_Monitors


 XOrg IndexConfigurationHIDevices
FontsVideo CardsMonitors  


Contents

Introduction

Based on my own experiences from using a dual-monitor setup in Gentoo for quite some time, I have decided to write a little howto on how to do it, for using both Xinerama and separate screens. I've even gotten 3d acceleration working (if not at the best possible speeds) in both setups.

Does setting up a dualhead under linux really have to be so hard? It's so elementary!

Setting up Two Graphics Cards

Prerequisites

In all likelihood, you are probably using either two PCI graphics cards or one AGP card and one PCI card. Either way, it is quite quick and easy to make a new xorg.conf or XF86Config for your new cards.

First, of course, make sure you are using a recent version of X for best results. I'm using X.org 6.7.0, and I've also had this working with XFree86 4.3.x. XFree86 4.2.x should also work, but I wouldn't recommend anything older than that.

Now backup your existing X configuration - things could go wrong, or you might need it for reference later.

Disable X from starting at boot (rc-update del xdm), shut down your computer, insert both graphics cards, and boot the computer back up again. The screen that your bios information shows up on is your "primary" monitor. If this is the wrong one, and you are using an AGP and a PCI graphics card, there should be an option in your BIOS that lets you choose which one to use.

Configuring X

In most cases, it is simplest to let X do as much auto-configuring as possible. It can usually detect your graphics cards, at least.

As root run,

Code: X Auto-Configuration
X -configure

This will make your screen blink a few times, before returning with a message saying that it has created a test X configuration file at /root/XF86Config.new or /root/xorg.conf.new and giving the command line to test the X server using this config file.

With a bit of good luck, this should be a working X configuration. You may have to edit the mouse, monitor, or resolution settings. This is done in the same way as with a single-monitor setup, but there will be two "Monitor" sections, two "Device" sections, and two "Screen" sections. The "Screen" sections connect a monitor to a graphics card.

It is probably a good idea to change the Identifiers of the device and monitor sections so you can tell them apart, e.g.

File: /etc/X11/xorg.conf or /etc/X11/XF86Config
...
Section "Monitor"
  Identifier   "NECMonitor"
...
Section "Monitor"
  Identifier   "VSMonitor"
...
Section "Device"
  Identifier  "NvidiaCard"
  Driver      "nvidia"
...
Section "Device"
  Identifier  "AtiCard"
  Driver      "ati"
...
Section "Screen"
  Identifier   "LeftScreen"
  Device       "NvidiaCard"
  Monitor      "NecMonitor"
  DefaultDepth 24
...
Section "Screen"
  Identifier   "RightScreen"
  Device       "AtiCard"
  Monitor      "VSMonitor"
  DefaultDepth 24

At the top of the file, there is a section called "ServerLayout". This section specifies the layout of your monitors. In my configuration, I have two monitors beside each-other--"RightScreen" is to the right of "LeftScreen".

The layout can be specified using keywords or absolute pixel positions (useful for odd layouts, or even overlapping layouts!?) E.g.

File: /etc/X11/xorg.conf or /etc/X11/XF86Config
Section "ServerLayout"
  Identifier     "XFree86 Configured"
  Screen      0  "LeftScreen" 0 0
  Screen      1  "RightScreen" RightOf "LeftScreen"

"LeftScreen" is located at position 0,0. I then have "RightScreen" to the right of it.

The useable keywords are "RightOf <identifier>", "LeftOf <identifier>", "Above <identifier>", and "Below <identifier>". A special keyword is "Relative" - it is used to specify the position in pixels of a screen in relation to another screen. E.G.

File: /etc/X11/xorg.conf or /etc/X11/XF86Config
  Screen      0  "LeftScreen" 0 0
  Screen      1  "RightScreen" Relative "LeftScreen" 1024 40

In most cases, the LeftOf and RightOf keywords are what you want.

So, try starting the xserver using your test configuration file again. Verify that the mouse can move from screen-to-screen in a relatively intuitive manner, and that your resolution and refresh rate is right. You can then copy your configuration file overtop of your old /etc/X11/XF86Config or /etc/X11/xorg.conf.

Setting up a dual/tri/multi-head graphics card

Nvidia

I recently configured my Nvidia GeForce 4 MX 440 card for dual monitors. One screen would display totally fine, but I just couldn't get the second monitor to display anything. Then I realized that I wasn't specifying the device correctly (I have an AGP card), so for all of you that have AGP cards, make sure to specify something like this:

       Section "Device"
               Identifier  "Card0"
               Driver      "nvidia"
               VideoRam    65536
               VendorName  "nVidia Corporation"
               BoardName   "NV17 [GeForce4 MX 440]"
               BusID       "AGP:01:00:0"
       EndSection

--stockholm 23:37, 19 Apr 2005 (GMT)

TwinView

NOTE: Beware of computer freezes when using the NVIDIA drivers. Applies to nvidia-glx- for sure. Try different driver versions if you have lock ups. I found the version to work fine.

TwinView is a configuration for two monitors connected to one card, that will appear as one screen to the X server. There are fewer disadvantages to TwinView in Linux compared to Windows since the Nvidia driver provides its own Xinerama extension, allowing Xinerama-aware window managers and applications to be aware of monitor borders. Most 3D apps are not prepared for a double-width resolution (including, for example, UT2004) and will annoyingly appear in the middle of the virtual screen, across the split, unless you specify a MetaMode at the correct resolution for only one monitor (see Device section given below).

So that Xinerama becomes effective, your window manager must be compiled with the xinerama use flag (for KDE users do not forget qt).

Configure the server for one Monitor and Screen:

File: /etc/X11/xorg.conf or /etc/X11/XF86Config
Section "ServerLayout"
    Screen      0  "Screen0" 0 0
...

Section "Monitor"
    Identifier   "Monitor0"
...

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "Monitor0"
...

And configure one Device with TwinView. Note the MetaModes option, which is a semicolon-delimited list of the modes of one or both monitors. For full screen games, you will probalbly want at least one single-monitor MetaMode (eg: 1280x1024;) that the game can use. Replace "UseEdidFreqs" with appropriate horizontal and verticle refresh rates if your monitors don't report these values correctly. Of course, replace BusID with the appropriate value for your card (hint: lspci).

inspirion X11 # lspci
<...>
05:00.0 VGA compatible controller: nVidia Corporation NV41.8 [GeForce Go 6800] (rev a2)
<...> 
inspirion X11 #  

Note that "05:00.0" is "5:0:0" in the configuration file. PCI and PCI-Express cards will start with PCI:, while AGP cards will start with AGP:

File: /etc/X11/xorg.conf
Section "Device"
    Identifier  "Card0"
    Driver      "nvidia"
    VendorName  "nVidia Corporation"
    BoardName   "geForce 6600 GT"
    BusID       "PCI:5:0:0"
    Screen      0
#other options I recommend:
    Option     "RenderAccel"
    Option     "HWcursor"
    Option     "CursorShadow"
    Option     "CursorShadowAlpha" "32"
    Option     "CursorShadowXOffset" "3"
    Option     "CursorShadowYOffset" "3"
#if you want Composite and GLX (they don't cooperate):
    Option     "AllowGLXWithComposite"
#the TwinView stuff
    Option     "TwinView"
    Option     "MetaModes"  "1280x1024,1280x1024; 1280x1024; 1024x768,1024x768; 1024x768; 800x600,800x600; 800x600"
    Option     "TwinViewOrientation"      "RightOf"
    Option     "SecondMonitorHorizSync"   "UseEdidFreqs"
    Option     "SecondMonitorVertRefresh" "UseEdidFreqs"
EndSection

A possible downside with the above config is that it generally requires both monitors are turned on when issuing the command "startx" or when gdm loads. If x doesn't find both monitors, it falls back to the non-twin view setup and you'll have to restart x with the second monitor turned on.

Connecting a second monitor after X startup

A way around this is to add to section device to override detection of attached displays. If you use DVI cables with your LCD monitor then replace crt with dfp (digital flat panel). The inverse is important: if you use your LCD in analog mode (non-dvi cable) you should refer to the monitor as "CRT". You can also change the order here.

File: /etc/X11/xorg.conf or /etc/X11/XF86Config
Section "Device"
 ...
Option "ConnectedMonitor" "CRT,CRT"
 ...
End Section

Since the monitor is not connected on startup and can not be queried for frequencies(no edid), you will probably have to specify them. You can use the above "SecondMonitorHorizSync" option, the "HorizSync" option(see nvidia's README) or you might have to put the vertical refresh in the Metamodes option(see the "_60" in the MetaModes option below). If you don't know which monitor you'll use, you can change the settings later on with the nvidia-settings utility.

If you occasionally lose your mouse to the second (non-connected) monitor or if you want to save some energy(laptop users), you can disable the second monitor on entering X. In order to do that, you have to have a MetaMode where the second monitor is switched off, i.e. something like

Option "MetaModes" " DFP-0: 1440x900,CRT-0: 1280x1024_60; DFP-0: 1440x900, CRT-0: NULL"

If you use nvidia-drivers-100.14.19(and possibly others), xrandr will show you something like this

$ xrandr
Screen 0: minimum 1440 x 900, current 2720 x 1024, maximum 2720 x 1024
default connected 2720x1024+0+0 0mm x 0mm
   2720x1024      50.0*
   1440x900       51.0

Now you can switch the second monitor on and off with

xrandr -r 51.0 -s 1440x900

and

xrandr -r 50.0 -s 2720x1024

kde 3.5.7 and compiz-fusion play along nicely as long as they are started when both displays are activated(not necessarily connected).

For KDE/GNOME: Make sure that either Qt or Metacity has the xinerama flag enabled. This is something to watch out for when moving from a single to dual head configuration as its easy to overlook.

Non-TwinView

From the NVidia driver README (Appendix P):

Graphics chips that support TwinView (Appendix G) can also be configured to treat each connected display device as a separate X screen.

There are several disadvantages to this approach as compared to TwinView. For instance, extra overhead for X11's Xinerama extension to be able to drag windows between X screens; software OpenGL will be used with windows spanning two or more X screens. However, it does offer several advantages over TwinView:

Model your Device section after this one:

File: /etc/X11/xorg.conf or /etc/X11/XF86Config
...

Section "Device"
    Identifier  "GeForce out 1"
    Driver      "nvidia"
    Option      "RenderAccel" "true"
    BusID       "PCI:1:0:0"
    Screen       0
EndSection

Section "Device"
    Identifier  "GeForce out 2"
    Driver      "nvidia"
    Option      "RenderAccel" "true"
    BusID       "PCI:1:0:0"
    Screen       1
EndSection

Use the standard dual-head ServerLayout, Screen, and Monitor sections. Note that TwinView has not been used.

ATI

With the Open Source Drivers

MergedFB, Pseudo Xinerama:

You can use multiple monitors without the proprietary drivers, by enabling MergedFB dualhead. The xorg driver is capable of running 3D accelleration on both of the monitors at the same time.

Note: The maximum framebuffer size that the 2D acceleration engine can handle is 8192x8192. The maximum framebuffer size that the 3D engine can handle is 2048x2048.

For this you will need support for Direct Rendering Manager in your kernel. Go to your kernel source directory and configure it:

# cd /usr/src/linux
# make menuconfig

Navigate to Device Drivers ---> Character devices ---> Image:Atidrm.png

Make sure you have <M> near Direct Rendering Manager and ATI Radeon options (see screenshot )

then run

# make modules && make modules_install

to load newly compiled modules run

# modprobe radeon

it will load the driver for your graphics card and the drm module.

gentoo linux # lsmod
Module                  Size  Used by
radeon                110880  2
drm                    58132  3 radeon

Generally you will want to edit file /etc/modules.autoload.d/kernel-2.6

# echo radeon >> /etc/modules.autoload.d/kernel-2.6
# update-modules

Now you have to edit your xorg.conf

File: /etc/X11/xorg.conf (generic example)
Section "Device"
        Identifier  "Card0"
        Driver      "radeon"
        VendorName  "ATI Technologies Inc"
        BoardName   "RV380 0x3e50 [Radeon X600]"
        BusID       "PCI:1:0:0"  #!!!Edit this
        Option      "DynamicClocks" "on" # optional
        Option      "MergedFB"	"true"
        Option      "CRT2Position" "LeftOf"

EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultDepth     24
        SubSection "Display"
                Depth     24
                Modes    "1280x1024" "1024x768" "800x600" "640x480"
                Virtual   2560 1024 #The first value is the summ of horizontal resolutions your displays use
         EndSubSection
EndSection

You dont even have to modify your ServerLayout section of xorg.conf

a working xorg.conf example with use of mergedFB can be found here: http://mg.pov.lt/xorg.conf

Original Xinerama:

You can use multiple monitors without the proprietary drivers, by enabling xinerama, but you lose 3D acceleration by doing it this way. Don't forget to run "eselect opengl set xorg-x11" before starting X for the first time or GLX wont load. Also re-emerge your window manager with the xinerama USE flag.

Warning: opengl-update is deprecated, don't use it!
File: An example /etc/X11/xorg.conf or /etc/X11/XF86Config (Just the relavant sections..)
Section "ServerFlags"	 
    Option "Xinerama" "On"	 
EndSection	 

Section "Module"	 
    Load "dbe" # Double-Buffering Extension	 
    Load "v4l" # Video for Linux	 
    Load "extmod"	 
    Load "type1"	 
    Load "freetype"	 
    Load "glx"	 
    Load "dri"	 
EndSection	 
	 
...	 
Section "Device"	 
    Identifier "device0"	 
    VendorName "ATI"	 
    BoardName "ATI Radeon"	 
    Driver "radeon"	 
    BusID "PCI:1:0:0"	 
    Screen 0	 
EndSection	 
	 
Section "Device"	 
    Identifier "device1"	 
    BoardName "ATI Radeon"	 
    Driver "radeon"	 
    BusID "PCI:1:0:0"
    Screen 1
EndSection

Section "Monitor"
    Identifier "monitor0"
    Option "DPMS"
EndSection

Section "Monitor"
    Identifier "monitor1"
    Option "DPMS"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "device0"
    Monitor "monitor0"
    DefaultColorDepth 24
    Subsection "Display"
        Depth 24
        Virtual 1280 1024
        Modes    "1280x1024"
    EndSubsection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device "device1"
    Monitor "monitor1"
    DefaultColorDepth 24
    Subsection "Display"
        Depth 24
        Virtual 1280 1024
        Modes    "1280x1024"
    EndSubsection
EndSection

Section "ServerLayout"
    Identifier "Multihead layout"
    InputDevice "Keyboard1" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    Screen  "Screen0" 0 0
    Screen  "Screen1" RightOf "Screen0"
EndSection

With the proprietary binary driver

As of the 8.19.10 ati-drivers release, Xinerama is natively supported inside the official ati-drivers themselves. Here are some tips for getting ATI "Big Desktop", the ATI Xinerama extension, and hardware DRI all working together. This configuration allows auto-detection of the presence of the secondary display.


Newer ati-drivers come with a handy aticonfig script that actually produces a working dual-head setup. This is the quick-and-easy way. Log out of X, backup your xorg.conf and run something akin to the following line:


Warning: currently the --iagp option doesn't exist (I think it was removed in v8.25.18)
# aticonfig --initial=dual-head --dtop=horizontal --screen-layout=right --iagp=off -v
# /etc/init.d/xdm restart

On one setup (amd64), KDE would instantly work with a streched desktop, when the monitors were the same size. On another setup (x86), KDE would only use one screen, when the monitors were of different size. Both systems did NOT use the xinerama flag. On this second system, all other tried window managers (Gnome and Fluxbox) would operate with no problems on both screens. In one occasion with a setup using gnome and monitors of different size, the bigger monitor was not completely filled.


If you would like to avoid butchering your xorg.conf file with aticonfig, here are the sections that will need to be added/modified. Note this example will setup a cloned screen for use with a laptop. To stretch across 2 monitors try Option "DesktopSetup" "horizontal". Also if you have more than one video card the BusID will probably need to be added somewhere.

File: /etc/X11/xorg.conf (proprietary binary driver example)
Section "Monitor"
	Identifier	"Monitor1"
	VendorName	"Generic"
	ModelName	"Flat Panel"
	#HorizSync	31.5 - 90.0
	#VertRefresh	75
	#DisplaySize	314 234
	#DisplaySize	285 214
	DisplaySize	339 271
EndSection

Section "Monitor"
	Identifier	"Monitor2"
	Option		"VendorName"	"ATI Proprietary Driver"
	Option		"ModelName"	"Generic Autodetecting Monitor"
	Option		"DPMS"		"true"
EndSection

Section "Device"
	Identifier	"ATI Graphics Adapter1"
	Driver		"fglrx"
	BoardName	"ATI Radeon Mobility x300"
	Option		"no_accel"		"no"
	Option		"no_dri"		"no"
	Option		"mtrr"			"no"  # disable DRI mtrr mapper, driver has its own code for mtrr
	Option		"MonitorLayout"		"LVDS, AUTO" #"LVDS, NONE" #"AUTO, NONE"
	Option		"IgnoreEDID"		"off"
	Option		"HSync2"		"unspecified" #"31.5 - 90.0"
	Option		"VRefresh2"		"unspecified" #"75"
	Option		"ScreenOverlap"		"0"
	Option		"NoTV"			"yes"
	Option		"TVStandard"		"NTSC-M"
	Option		"TVHSizeAdj"		"0"
	Option		"TVVSizeAdj"		"0"
	Option		"TVHPosAdj"		"0"
	Option		"TVVPosAdj"		"0"
	Option		"TVHStartAdj"		"0"
	Option		"TVColorAdj"		"0"
	Option		"GammaCorrectionI"	"0x00000000"
	Option		"GammaCorrectionII"	"0x00000000"
	Option		"Capabilities"		"0x00000000"
	Option		"VideoOverlay"		"on"
	Option		"OpenGLOverlay"		"off"
	Option		"CenterMode"		"off"
	Option		"PseudoColorVisuals"	"off"
	Option		"Stereo"		"off"
	Option		"StereoSyncEnable"	"1"
	Option		"FSAAEnable"		"no"
	Option		"FSAAScale"		"1"
	Option		"FSAADisableGamma"	"no"
	Option		"FSAACustomizeMSPos"	"no"
	Option		"FSAAMSPosX0"		"0.000000"
	Option		"FSAAMSPosY0"		"0.000000"
	Option		"FSAAMSPosX1"		"0.000000"
	Option		"FSAAMSPosY1"		"0.000000"
	Option		"FSAAMSPosX2"		"0.000000"
	Option		"FSAAMSPosY2"		"0.000000"
	Option		"FSAAMSPosX3"		"0.000000"
	Option		"FSAAMSPosY3"		"0.000000"
	Option		"FSAAMSPosX4"		"0.000000"
	Option		"FSAAMSPosY4"		"0.000000"
	Option		"FSAAMSPosX5"		"0.000000"
	Option		"FSAAMSPosY5"		"0.000000"
	Option		"UseFastTLS"		"0"
	Option		"BlockSignalsOnLock"	"on"
	Option		"UseInternalAGPGART"	"yes"
	Option		"ForceGenericCPU"	"no"
	Option		"DesktopSetup"		"clone" #or horizontal to stretch
	BusID		"PCI:1:0:0"    # vendor=1002, device=5460
EndSection

Section "Device"
	Identifier  "ATI Graphics Adapter2"
	Driver      "fglrx"
	BusID       "PCI:1:0:0"
	Screen      1
EndSection

Section "Screen"
	Identifier	"Screen1"
	#Device		"ATI OSS"
	Device		"ATI Graphics Adapter1"
	Monitor		"Monitor1"
	DefaultDepth	24

	Subsection "Display"
		Depth	8
		Modes	"1280x1024" "1024x768" "800x600" "640x480"
		ViewPort	0 0
	EndSubsection
	Subsection "Display"
		Depth	16
		Modes	"1280x1024" "1024x768" "800x600" "640x480"
		ViewPort	0 0
	EndSubsection
	Subsection "Display"
		Depth	24
		Modes	"1280x1024" "1024x768" "800x600" "640x480"
		ViewPort	0 0
	EndSubsection
EndSection

Section "Screen"
	Identifier	"Screen2"
        Device		"ATI Graphics Adapter2"
        Monitor		"Monitor2"
        DefaultDepth	24
        SubSection "Display"
		Depth	24
		Viewport   0 0
        EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"Simple Layout"
	Screen		"Screen1"	0 0
	#InputDevice	"Mouse1"	"CorePointer"
	InputDevice	"Touchpad1"	"CorePointer"
	InputDevice	"Keyboard1"	"CoreKeyboard"
EndSection

Section "DRI"
	Mode	0666
EndSection


If the aticonfig method does not work, you need to tweak xorg.conf a bit.

Added by James Masson

The known options for use within the ATI Device section of xorg.conf are documented here:

This is a community generated manpage created from public records, and is also available here via cvs.

Added By EasyTarget
File: /etc/X11/xorg.conf snippit (proprietary binary driver example)
Section "Device"
        Identifier  "aticonfig-Device[0]"
        Driver      "fglrx"
        Option      "DesktopSetup" "horizontal"
        Option      "PairModes" "1440x900+1280x1024"
EndSection


Section "Screen"
        Identifier "aticonfig-Screen[0]"
        Device     "aticonfig-Device[0]"
        Monitor    "aticonfig-Monitor[0]"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                #This virtual is for 2 monitors, a 1440x900 next
                # to a 1280x1024
                Virtual   1440 1024
                Depth     24
        EndSubSection
EndSection

Matrox

A distribution neutral forum for matrox related issues can be found at tuxx-home.at Support Forum. The bundled mga and mga_hal drivers there have worked on my Gentoo system.

Here are some notes for a Matrox G550, successfully running Xinerama on two Dell P991s, with no acceleration yet.

File: /etc/X11/XF86Config fragments
Section "ServerFlags"
 Option "Xinerama" "on"
EndSection
Section "Device"
 Identifier 	"Matrox0"
 Driver		"mga"
 BusID		"PCI:1:0:0"	#check this with lspci
 Screen 0
EndSection
Section "Device"
 Identifier 	"Matrox1"
 Driver		"mga"
 BusID		"PCI:1:0:0"	#check this with lspci
 Screen 1
EndSection

To

You still need to specify the Screen and ServerLayout sections in the usual way. Relevant kernel options were as follows

Kernel 2.6.9 Options
->Character Devices
   <*> /dev/agpgart (AGP Support)
   <*> Matrox g200/g400

To get the hardware acceleration with dual Monitors, You need the additional driver from Matrox called "mga_hal_drv.o". It might not be available for your version of the X server, though. Copy it to /usr/X11R6/lib/modules/drivers. Now You can use a configuration like that:

File: /etc/X11/XF86Config fragments
Section "ServerFlags"
 Option "Xinerama" "off"
EndSection
Section "Device"
 Identifier "Matrox"
 Driver     "mga"
 BusID      "PCI:1:0:0"        #check this with lspci
EndSection
Section "Screen"
 Identifier "Screen Merged"
 Device     "Matrox"
 Monitor    "Monitor0"
 Option     "MergedFB"         "on"
 Option     "Monitor2Position" "LeftOf" #Position of the second Monitor
 Option     "MetaModes"        "1024x768-1024x768 800x600-800x600 1024x768 800x600" #Display sizes
 # add the second Monitor data here
 Option     "Monitor2HSync"    "30-80"
 Option     "Monitor2VRefresh" "50-120"
 DefaultDepth 16
 SubSection "Display"
  Virtual 2048 768
  Depth 16
  Modes    "1024x768" "800x600"
 EndSubSection
EndSection

Matrox G200

With the G200, G450, and G550 in some configurations, the vanilla mga driver isn't enough to get dual head working. You also need the binary HAL driver from Matrox. The latest version hides at ftp://ftp.matrox.com/pub/mga/archive/linux/2005/

Once you've downloaded the driver pack and used the install script to install the right XFree86 module, you will be able to set things up with xinerama and X thinking you have two (or up to 4, with the right card) graphics cards. As before, configure two driver sections (one for each entry in the pci bus), two screen sections (one for each device), and then define them to be linked in the server layout:

File: /etc/X11/XF86Config fragments
Section "ServerFlags"
 Option "Xinerama" "on"
EndSection
Section "Device"
 Identifier 	"Matrox0"
 Driver		"mga"
 BusID		"PCI:2:0:0"	#check this with lspci. first entry, probably called a video controller
 Screen 0
EndSection
Section "Device"
 Identifier 	"Matrox1"
 Driver		"mga"
 BusID		"PCI:2:4:0"	#check this with lspci, probably won't be called a video controller
 Screen 1
EndSection
Section "Screen"
 Identifier  "Screen 0"
 Device      "Matrox0"
 Monitor     "MyMonitor"
 DefaultDepth 16
   Subsection "Display"
       Depth       16
       Modes       "1024x768" "800x600" "640x480"
       ViewPort    0 0
   EndSubsection
EndSection
Section "Screen"
 Identifier  "Screen 1"
 Device      "Matrox1"
 Monitor     "MyMonitor"
 DefaultDepth 16
   Subsection "Display"
       Depth       16
       Modes       "1024x768" "800x600" "640x480"
       ViewPort    0 0
   EndSubsection
EndSection
Section "ServerLayout"
 # These bits as per your current settings
 Identifier      "Default Layout"
 InputDevice     "Generic Keyboard"
 InputDevice     "Generic Mouse"
 # Replace 'Screen "Screen 0"' with this
 Screen "Screen 0" LeftOf "Screen 1"
 Screen "Screen 1"
EndSection

Jeronimo

To get your Jeronimo card to work, you need to use the glint driver like that

File: /etc/X11/xorg.conf or /etc/X11/XF86Config


...

Section "Device"
   Identifier  "Texas Instruments TVP4020 [Permedia 2] 1"
   Driver      "glint"
   BusID       "PCI:3:01:0"
   Option      "XaaNoOffscreenPixmaps"
EndSection

Section "Device"
   Identifier  "Texas Instruments TVP4020 [Permedia 2] 2"
   Driver      "glint"
   BusID       "PCI:3:05:0"
   Option      "XaaNoOffscreenPixmaps"
EndSection

...

Section "Screen"
   Identifier  "Screen 1"
   Device      "Texas Instruments TVP4020 [Permedia 2] 1"
   Monitor     "Monitor 1"
   DefaultDepth 16

 Subsection "Display"
   Depth       16
   Modes       "1024x768"
   ViewPort    0 0
 EndSubsection
EndSection

...


if you have a 4port jeronimo, repeat the device section 4 times and enumerate the identifier properly and of course for every other section too, like described above. The old jeronimo hasn't much memory so you need to minimize Depth and Modes in your screen section. Depth 16 and Modes "1024x768" works for me.

SiS

Thomas Winischhofer web page has information on how to setup dual monitors. The best way is to use the Merged Framebuffer Mode. It is possible to control the screens with x11-misc/sisctrl.

SiS 771/671 PCIE

I have been able to get xinerama and cloned monitors. These are the relevant sections of /etc/X11/xorg.conf

Section "Device"
 Identifier  	"Device0"
 Driver      	"sis"
 VendorName  	"Silicon Integrated Systems [SiS]"
 BoardName   	"771/671 PCIE VGA Display Adapter"
 BusID		"PCI:1:0:0"
 Option 	"EnableSiSCtrl" "yes"
 Option 	"DRI" "off"
 Option 	"MergedFB" "auto"
 Option 	"MetaModes" "1280x1024-1280x800 1280x1024+800x600"
 Option 	"MergedDPI" "100 100"
EndSection

Using multiple screens

With the way I have the X configuration set above, you are given two separate "screens". These "screens" are what the extra ".0" in your DISPLAY variable are for. To make an application run on a different screen than it would normally start on, run it as

DISPLAY=":0.1" programname

where the 1 refers to the screen number that you want it to appear on.

The Gimp has a special feature with screens. Right-click on an image, choose "View->Move to Screen", and a dialog will pop up allowing you to move the image window to a different screen.

Using multiple screens in this way gives advantages mainly in terms of speed and hardware acceleration, and in allowing different colour depths on different screens.

The disadvantage is that you cannot move windows between two screens unless your program has a facility for doing this internally. As well, programs cannot overlap screens or stretch over all of them.

One advantage is that your window manager effectively runs independently on each screen, so you can have (say) eight workspaces on one, and eight on the other.

Moving focus between screens

It is no problem to move the mouse pointer between dual head screens, if you don't mind reaching for your mouse. After searching endlessly for something to allow me to move the pointer between non-xinerama dual head screens purely from the keyboard and finding nothing, I've written a program to accomplish this:

http://da.mcbf.net/pub/switchscreen-0.4.tar.gz (mirror, since http://homepages.paradise.net.nz/daveantl/switchscreen-0.4.tar.gz is down)

Compile it up (see comment in source) and bind it to a key in fluxbox.

File: ~/.fluxbox/keys
# switch between groups
Mod1 Tab :PrevWindow 5
Mod1 Shift Tab :NextWindow 5

# switch between workspaces
Mod1 Up : Mod1 Down :NextWorkspace

# switch between group members
Mod1 Left :PrevTab
Mod1 Right :NextTab

# switch between screens
Mod1 End :ExecCommand /usr/local/bin/dualmouse

It uses the XTEST extension to perform a 'fake' absolute mouse pointer move. It remembers the previous pointer location so you can effortlessly switch backwards and forwards between two screens. It could do with a little more work but it's perfectly functional right now. The XWarpPointer library function didn't seem to allow moving between screens so I use XTestFakeMotionEvent instead.

It can be used with any window manager since it uses pure X11 library calls. However combined with fluxbox and keybindings to change virtual desktops, it allows me to easily change between sixteen virtual workspaces across two heads without using the mouse at all. I hope you enjoy it! -- meowsqueak

xbindkeys is another way to go for other window managers than fluxbox -- Mad_C

Controlling your window manager

The program x11-misc/wmctrl can be used manually or within scripts to change workspaces and windows on either screen.

Disable KDE MultiHead

KDE Session Manager tries to manage all possible screens that are currently running. This default behaviour may be unwanted, e.g. using secondary screen for watching movies, therefore pure X screen is a much better solution.

To disable MultiHead in KDE, edit /usr/kde/.../share/config/kcmdisplayrc and add following:

[X11]
disableMultihead=true

Using Xinerama

If you want/need the features that you don't get with multiple screens, you can have them by using Xinerama, but at the expense of speed and causing problems with some hardware accelerated apps.

To enable Xinerama, add the following new section to your X configuration file:

File: /etc/X11/xorg.conf or /etc/X11/XF86Config
Section "ServerFlags"
  Option    "Xinerama" "true"
EndSection

And restart X.

The main reason that X might not start after this is problems relating to conflicting colour depths - both monitors must run at the same color depth. If one of your graphics cards is limited in memory, you can either lower the resolution on it, or lower the color depth on both monitors.

With Xinerama, both monitors are formed into one virtual screen. Apps can move over it, and windows can overlap. Some programs that use e.g. fullscreen may not work correctly unless they are recompiled with "xinerama" added to your USE flags.

Enabling xinerama support in an application allows it to know where monitor bounderies are. E.g. in metacity (the gnome window manager), it enables better placement of newly opened windows, and keeps windows on the screen better.

Troubleshooting

Added by Castreuil Anthony

If you have problems with windows spanning across your dual or triple monitors, or you seem to notice that your windows don't seem to "snap" to your screens, you probably haven't compiled your favorite window manager with the xinerama use flag. (if it supports it, that is). When you compile or recompile your window manager (eg. Gnome's Metacity) with the xinerama use flag, your windows will only maximize to one screen. This is a small, but important issue that people tend to overlook at first (including myself).

Mouse Jail: How to lock your mouse in the monitor

Added by Marion Sebastien

Playing games when using a dual monitor configuration can be a pain. The problem is that the mouse would move to the other monitor while playing the game, and you would lose control of the mouse for your game. To avoid this problem, I've written a small program, mostly based on David Antliff's switchscreen program. The idea is simply to lock your mouse in the monitor it currently is in. The tarball for this program is available at http://www.cs.kent.ac.uk/~sm244/Jail.tar.gz . You can then simply bind a shortcut key to the program from your window manager.

Switchscreen

Added by Percy Jahn

I liked to use my second output for TV only. The Problem is the same as in "Mouse Jail" described above, which means i have to run jail at startup. So i decided, to use another solution. I configured my second Screen "far away" from the first one:

File: /etc/X11/xorg.conf or /etc/X11/XF86Config

Section "ServerLayout"

       Identifier     "double"
       Screen         0 "Screen0" 0 0
       Screen         1 "Screen1" 2000 0
       InputDevice    "Mouse0" "CorePointer"
       InputDevice    "Keyboard0" "CoreKeyboard"

EndSection

X Configured like above, prevents you from moving your mouse to the second screen. If i like to move the mouse there, i use a hotkey configured on my Window Manager, which runs Switchscreen (see link above) to move the mouse on the second screen. Now i'm able to view TV on my second screen (e.g. "DISPLAY=:0.1 xine -f test.avi") while working on the first one.

Added by David Mohr

I liked it that my cursor can cross the screens, but Jail did not work for me (Warcraft III was lagging when Jail worked to keep the cursor in the right screen). So I configured the screens "far away" like mentioned above in this section, and then adapted the Jail program to allow the crossing of the cursor: http://dsp.mcbf.net/releases/mouse-switchscreen-0.3b.tar.bz2 . It turns out that allowing the cursor to cross over is much easier for the computer than it is to jail the cursor. The included "mouse-switchscreen.sh" script makes it easy to toggle the feature with a keyboard shortcut. That way you can have it on by default, and turn it off quickly when starting a game.

Added by HaPhi

If Screen 1 has a lower resolution than Screen 0 (e.g. TV), you can also stack screen 1 on top of screen 0:

       Screen         0 "Screen0" 0 0
       Screen         1 "Screen1" 0 0

Then you can switch to Screen 0 with switchscreen and come back to Screen 1 by moving the mouse across the bottom or right border! The mouse will still be jailed in screen 0.

Added by BRiG

Also you can configure one monitor as the side of another.

File: /etc/X11/xorg.conf or /etc/X11/XF86Config

Section "ServerLayout"

       Identifier     "double"
       Screen         0 "Screen0" 
       Screen         1 "Screen1" LeftOf "Screen0"
       InputDevice    "Mouse0" "CorePointer"
       InputDevice    "Keyboard0" "CoreKeyboard"

EndSection

When you move the mouse to the left of the screen 0 appears in the screen 1.

Sample Configurations

Links

Console

* How is this done on the console? If I am not interested in X.
Retrieved from "http://www.gentoo-wiki.info/HOWTO_Dual_Monitors"

Last modified: Sun, 07 Sep 2008 16:08:00 +1000 Hits: 433,091

Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.