Chapter 12. Configuring Multiple Display Devices on One X Screen

Multiple display devices (digital flat panels, CRTs, and TVs) can display the contents of a single X screen in any arbitrary configuration. Configuring multiple display devices on a single X screen has several distinct advantages over other techniques (such as Xinerama):

If you are interested in using each display device as a separate X screen, see Chapter 14, Configuring Multiple X Screens on One Card.

Relevant X Configuration Options

When the NVIDIA X driver starts, by default it will enable as many display devices as are connected and as the GPU supports driving simultaneously. Most NVIDIA GPUs based on the Kepler architecture, or newer, support driving up to four display devices simultaneously. Most NVIDIA GPUs older than Kepler support driving up to two display devices simultaneously.

If multiple X screens are configured on the GPU, the NVIDIA X driver will attempt to reserve display devices and GPU resources for those other X screens (honoring the "UseDisplayDevice" and "MetaModes" X configuration options of each X screen) and then allocate all remaining resources to the first X screen configured on the GPU.

There are several X configuration options that influence how multiple display devices are used by an X screen:

    Option "MetaModes"                "<list of MetaModes>"

    Option "HorizSync"                "<hsync range(s)>"
    Option "VertRefresh"              "<vrefresh range(s)>"

    Option "MetaModeOrientation"      "<relationship of head 1 to head 0>"
    Option "ConnectedMonitor"         "<list of connected display devices>"

See detailed descriptions of each option below.

Detailed Description of Options

HorizSync, VertRefresh

With these options, you can specify a semicolon-separated list of frequency ranges, each optionally prepended with a display device name. In addition, if SLI Mosaic mode is enabled, a GPU specifier can be used. For example:

    Option "HorizSync"   "CRT-0: 50-110; DFP-0: 40-70"
    Option "VertRefresh" "CRT-0: 60-120; GPU-0.DFP-0: 60"

See Appendix C, Display Device Names on Display Device Names for more information.

These options are normally not needed: by default, the NVIDIA X driver retrieves the valid frequency ranges from the display device's EDID (see the UseEdidFreqs option). The "HorizSync" and "VertRefresh" options override any frequency ranges retrieved from the EDID.

MetaModes

MetaModes are "containers" that store information about what mode should be used on each display device.

Multiple MetaModes list the combinations of modes and the sequence in which they should be used. In MetaMode syntax, modes within a MetaMode are comma separated, and multiple MetaModes are separated by semicolons. For example:

    "<mode name 0>, <mode name 1>; <mode name 2>, <mode name 3>"

Where <mode name 0> is the name of the mode to be used on display device 0 concurrently with <mode name 1> used on display device 1. A mode switch will then cause <mode name 2> to be used on display device 0 and <mode name 3> to be used on display device 1. Here is an example MetaMode:

    Option "MetaModes" "1280x1024,1280x1024; 1024x768,1024x768"

If you want a display device to not be active for a certain MetaMode, you can use the mode name "NULL", or simply omit the mode name entirely:

    "1600x1200, NULL; NULL, 1024x768"

or

    "1600x1200; , 1024x768"

Optionally, mode names can be followed by offset information to control the positioning of the display devices within the virtual screen space; e.g.,

    "1600x1200 +0+0, 1024x768 +1600+0; ..."

Offset descriptions follow the conventions used in the X "-geometry" command line option; i.e., both positive and negative offsets are valid, though negative offsets are only allowed when a virtual screen size is explicitly given in the X config file.

When no offsets are given for a MetaMode, the offsets will be computed following the value of the MetaModeOrientation option (see below). Note that if offsets are given for any one of the modes in a single MetaMode, then offsets will be expected for all modes within that single MetaMode; in such a case offsets will be assumed to be +0+0 when not given.

When not explicitly given, the virtual screen size will be computed as the the bounding box of all MetaMode bounding boxes. MetaModes with a bounding box larger than an explicitly given virtual screen size will be discarded.

A MetaMode string can be further modified with a "Panning Domain" specification; e.g.,

    "1024x768 @1600x1200, 800x600 @1600x1200"

A panning domain is the area in which a display device's viewport will be panned to follow the mouse. Panning actually happens on two levels with MetaModes: first, an individual display device's viewport will be panned within its panning domain, as long as the viewport is contained by the bounding box of the MetaMode. Once the mouse leaves the bounding box of the MetaMode, the entire MetaMode (i.e., all display devices) will be panned to follow the mouse within the virtual screen, unless the "PanAllDisplays" X configuration option is disabled. Note that individual display devices' panning domains default to being clamped to the position of the display devices' viewports, thus the default behavior is just that viewports remain "locked" together and only perform the second type of panning.

The most beneficial use of panning domains is probably to eliminate dead areas -- regions of the virtual screen that are inaccessible due to display devices with different resolutions. For example:

    "1600x1200, 1024x768"

produces an inaccessible region below the 1024x768 display. Specifying a panning domain for the second display device:

    "1600x1200, 1024x768 @1024x1200"

provides access to that dead area by allowing you to pan the 1024x768 viewport up and down in the 1024x1200 panning domain.

Offsets can be used in conjunction with panning domains to position the panning domains in the virtual screen space (note that the offset describes the panning domain, and only affects the viewport in that the viewport must be contained within the panning domain). For example, the following describes two modes, each with a panning domain width of 1900 pixels, and the second display is positioned below the first:

    "1600x1200 @1900x1200 +0+0, 1024x768 @1900x768 +0+1200"

Because it is often unclear which mode within a MetaMode will be used on each display device, mode descriptions within a MetaMode can be prepended with a display device name. For example:

    "CRT-0: 1600x1200,  DFP-0: 1024x768"

If no MetaMode string is specified, then the X driver uses the modes listed in the relevant "Display" subsection, attempting to place matching modes on each display device.

Each mode of the MetaMode may also have extra attributes associated with it, specified as a comma-separated list of token=value pairs inside curly brackets. The value for each token can optionally be enclosed in parentheses, to prevent commas within the value from being interpreted as token=value pair separators. Currently, the only token that requires a parentheses-enclosed value is "Transform".

The possible tokens within the curly bracket list are:

  • "Stereo": possible values are "PassiveLeft" or "PassiveRight". When used in conjunction with stereo mode "4", this allows each display to be configured independently to show any stereo eye. For example:

        "CRT-0: 1600x1200 +0+0 { Stereo = PassiveLeft }, CRT-1: 1600x1200 +1600+0 { Stereo=PassiveRight }"
    

    If the X screen is not configured for stereo mode "4", these options are ignored. See the Stereo X configuration option for more details about stereo configurations.

  • "Rotation": this rotates the content of an individual display device. Possible values are "0" (with synonyms "no", "off" and "normal"), "90" (with synonyms "left" and "CCW"), "180" (with synonyms "invert" and "inverted") and "270" (with synonyms "right" and "CW"). For example:

        "DFP-0: nvidia-auto-select { Rotation=left }, DFP-1: nvidia-auto-select { Rotation=right }"
    

    Independent rotation configurability of each display device is also possible through RandR. See Chapter 16, Support for the X Resize and Rotate Extension for details.

  • "Reflection": this reflects the content of an individual display device about either the X axis, the Y axis, or both the X and Y axes. Possible values are "X", "Y" and "XY". For example:

        "DFP-0: nvidia-auto-select { Reflection=X }, DFP-1: nvidia-auto-select"
    

    Independent reflection configurability of each display device is also possible through RandR. See Chapter 16, Support for the X Resize and Rotate Extension for details.

  • "Transform": this is a 3x3 matrix of floating point values that defines a transformation from the ViewPortOut for a display device to a region within the X screen. This is equivalent to the transformation matrix specified through the RandR 1.3 RRSetCrtcTransform request. As in RandR, the transform is applied before any specified rotation and reflection values to compute the complete transform.

    The 3x3 matrix is represented in the MetaMode syntax as a comma-separated list of nine floating point values, stored in row-major order. This is the same as the value passed to the xrandr(1) '--transform' command line option.

    Note that the transform value must be enclosed in parentheses, so that the commas separating the nine floating point values are interpreted correctly.

    For example:

        "DFP-0: nvidia-auto-select { Transform=(43.864288330078125, 21.333328247070312, -16384, 0, 43.864288330078125, 0, 0, 0.0321197509765625, 19.190628051757812) }"
    

  • "ViewPortOut": this specifies the region within the mode sent to the display device that will display pixels from the X screen. The region of the mode outside the ViewPortOut will contain black. The format is "WIDTH x HEIGHT +X +Y".

    This is useful, for example, for configuring overscan compensation. E.g., if the mode sent to the display device is 1920x1080, to configure a 10 pixel border on all four sides:

        "DFP-0: 1920x1080 { ViewPortOut=1900x1060+10+10 }"
    

    Or, to only display an image in the lower right quarter of the 1920x1080 mode:

        "DFP-0: 1920x1080 { ViewPortOut=960x540+960+540 }"
    

    When not specified, the ViewPortOut defaults to the size of the mode.

  • "ViewPortIn": this defines the size of the region of the X screen which will be displayed within the ViewPortOut. The format is "WIDTH x HEIGHT".

    ViewPortIn is useful for configuring scaling between the X screen and the display device. For example, to display an 800x600 region from the X screen on a 1920x1200 mode:

        "DFP-0: 1920x1200 { ViewPortIn=800x600 }"
    

    Or, to display a 2560x1600 region from the X screen on a 1920x1200 mode:

        "DFP-0: 1920x1200 { ViewPortIn=2560x1600 }"
    

    Or, in conjunction with ViewPortOut, to scale an 800x600 region of the X screen within a 1920x1200 mode while preserving the aspect ratio:

        "DFP-0: 1920x1200 { ViewPortIn=800x600, ViewPortOut=1600x1200+160+0 }"
    

    Scaling from ViewPortIn to ViewPortOut is also expressible through the "Transform" attribute. In fact, ViewPortIn is just a shortcut for populating the transformation matrix. If both ViewPortIn and Transform are specified in the MetaMode for a display device, ViewPortIn is ignored.

  • "PanningTrackingArea": this defines the region of the MetaMode inside which cursor movement will influence pann