How to setup Dual Head for Intel Graphics with RandR 1.2

1. Introduction

This guide is targeted for people who want to use extended desktop mode on two outputs. Clone mode should work out-of-box with a normal configuration.

With RandR 1.2, you can setup dual head and add/remove monitor dynamically (i.e. on-the-fly, without restarting X).

To use RandR 1.2, you might need to know three key concepts: (Virtual) Screen, Crtc and Output. A display is in one (Virtual) screen which may consist of more than one Crtc. Every crtc will occupy one rectangle region in the (Virtual) screen and may have different modes. A crtc can connect to more than one output and decide the output's property. Output is a port to monitor.

Intel GFX device supports two pipes which is corresponding to crtc. So there can be two crtc with Intel GFX device.

Prerequisite: To use randr1.2, xserver 1.3 or above is required. And for Intel gfx driver, xf86-video-intel 2.0.0 or above is required.

Note: After the driver moving to Kernel Mode Setting, the name of output is changed (e.g. from LVDS to LVDS1).

2. Two methods to setup

We can setup dual head:
-- dynamically by using xrandr tool
or
-- statically by setting in xorg.conf.

xrandr tool (an app component in Xorg) is a command line interface to RandR extension, and can be used to set outputs for a screen dynamically, without any specific setting in xorg.conf. You can refer the xrandr manual for details.

Also you can setup dual head statically in xorg.conf. With RandR1.2 enabled drivers, monitors may be tied to specific outputs of the video card. You can refer the xorg.conf manual for details.

Below we will use examples to show how to setup dual head by both of ways.

2.1. Dynamically setup with xrandr

Xrandr can be used to change outputs' mode, rotation direction, position, etc. In this guide, we only introduce options related with dual head setting.

You can see the outputs' status with option '-q'. Below is an example:

# xrandr -q

Screen 0: minimum 320 x 200, current 2048 x 768, maximum 2048 x 2048

VGA connected 1024x768+0+0 (normal left inverted right x axis y axis) 304mm x 228mm

   1024x768       60.0*+   75.1     60.0*

   800x600        75.0     60.3

   640x480        75.0     60.0

   720x400        70.1

LVDS connected 1024x768+1024+0 (normal left inverted right x axis y axis) 304mm x 228mm

   1024x768       60.0*+   50.0

   800x600        60.3

   640x480        60.0     59.9

In above example, two outputs (VGA and LVDS) are connected, the resolution of both is 1024x768@60, output VGA's viewport is at (0, 0) and output LVDS's viewport is at (1024, 0), i.e. LVDS is located at right of VGA. The size of occupied area by both outputs is 2048x768. The virtual screen size (maximum framebuffer) is 2048x2048 which is statically set in xorg.conf (see next section). You can decrease the maximum with '--fb' option but can not increase it. You need make sure your screen size fall into the maximum framebuffer, otherwise you should increase the value in xorg.conf.

There are five xrandr options that can be used to set dual head:

      --pos <x>x<y>

      --left-of <output>

      --right-of <output>

      --above <output>

      --below <output>

The last four will set the output's relative position to another output, for example:

# xrandr --output VGA --left-of LVDS

Option '-pos' is more flexible which can place output to anywhere, for example:

# xrandr --output VGA --pos 200x200

# xrandr --output LVDS --pos 400x500

2.2. statically setup in xorg.conf

RandR1.2 configuration in xorg.conf is based on per monitor. So you need write a 'Monitor' section for each output and specify these monitors in 'Device' section.

Below is a example snippet in xorg.conf.

Section "Device"

        Identifier      "Intel 945G "

        Driver         "intel"

 

        # Using the name of the output defined by the video driver plus the identifier of a

        #     monitor section, one associates a monitor section with an output by adding an

        #     option to the Device section in the following format:

        #     Option "Monitor-outputname" "monitor ID"

        Option          "monitor-VGA" "foo"

        Option          "monitor-LVDS" "bar"

        #Option         "monitor-TMDS-1" "dvi"

EndSection

 

Section "Monitor"

        Identifier      "foo"

       

        # specifies a mode to be marked as the preferred initial mode of the monitor

        # Option "PreferredMode"  "800x600"

        # This optional entry specifies the position of the monitor within the X screen.

        #Option        "Position" "1024 0"

        #This optional entry specifies that the monitor should be ignored

        #     entirely, and not reported through RandR.  This is useful if the

        #     hardware reports  the  presence  of  outputs  that do not exist.

        #Option "Ignore"  "true"

EndSection

 

Section "Monitor"

        Identifier      "bar"

 

        #Options LeftOf, RightOf, Above, Below specify monitors' relative position

        Option "LeftOf"  "foo"

        # This optional entry specifies  whether  the  monitor  should  be

        #     turned  on  at  startup.  By default, the server will attempt to

        #     enable all connected monitors.

        #Option "Enable"  "true"       

        #This optional entry specifies the initial rotation of the given monitor.

        #     Valid values for rotation are "normal", "left", "right", and "inverted".

        # Option "Rotate"  "left"

EndSection

 

Section "Screen"

        Identifier      "Default Screen"

        Device        "Intel Corporation 945G Integrated Graphics Controller"

        Monitor       "foo"

        DefaultDepth  24

        SubSection "Display"

                Depth          24

                Modes         "1280x1024"  "1024x768"   "640x480"

        EndSubSection

EndSection

3. Reference

xorg.conf manual

xrandr manual