2009-05-07
How to set up your xorg.conf for RandR-based dual-headed systems
Theoretically, the usual way to set up your dual-headed
system on a modern machine that uses the modern XRandR extension is to run xrandr once
you've logged in to set things up. Suppose that you are not happy with
this; you want your system to be properly dual-headed from the moment
that X lights the display. This means that you need to have RandR set up
in your xorg.conf.
(Alternately, you can hope that your Linux version has a graphical X configurator that understands how to set this up once and preserve it afterwards. Let us assume that you are not in this situation.)
Assuming that you already have an xorg.conf to start from, here is
what you need, based on my experiences with an
ATI Radeon.
(I am going to assume that you are familiar with xorg.conf syntax in
general.)
- first, you need a "Monitor" section for each of your monitors.
These days I believe that the only important thing in it is the
Identifier, and whatever created yourxorg.confhas probably already set these up for you anyways. - next, you need to map XRandR outputs to monitors. This is done
in the "Device" section for your graphics card with directives
that look like:
Option "Monitor-DVI-0" "monitor1"
Option "Monitor-VGA-0" "monitor2"What you put after the
Monitor-is whateverxrandrprints out as the labels of your available outputs. - finally, you need to tell XRandR how the outputs should be laid out.
You do this in the "Monitor" section for at least one of your monitors,
with the appropriate one of the LeftOf, RightOf, Above, or Below
options:
Option "LeftOf" "monitor1"
(Note that there are potential issues in some setups about how you map your physical monitors to card outputs.)
Now there's a potential complication. XRandR places outputs within a
virtual screen, and this virtual screen has a maximum size that is
generally decided by defaults inside your graphics driver. It
is possible that the default maximum virtual screen size will not
be large enough to lay out all of your displays. To see if this
affects you, run xrandr and look at the information it tells
you about your screen, for example:
Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 1280 x 1200
At a maximum size of 1280x1200, this setup does not have a large enough
virtual screen to be dual-headed with two standard 1280x1024 LCDs. To
fix this you need to tell the driver to use a larger maximum virtual
screen size, which is done with the Virtual directive in the "Screen"
section's "Display" subsection:
Section "Screen"
[...]
Subsection "Display"
Virtual 2560 1024
[....]
EndSubSection
EndSection
I currently specify the exact virtual screen size that I'm going to need. I don't know what the effects of specifying a larger than necessary virtual screen are (it probably depends on the driver), but since I'm hard-coding everything else anyways I figure that I might as well be conservative.
(If nothing else, I don't have the desktop space to add a third display.)