Fine-Tuning Your Display Configuration






Fine-Tuning Your Display Configuration

Fedora's Anaconda installer detects and configures most display hardware optimally. However, there are some situations where it's necessary to override the default configuration to set up a desired display resolution and color depth.

How Do I Do That?

Fedora's display configuration program is called system-config-display.

If you have a working graphical display, you can start this program by selecting SystemAdministrationDisplay from the panel menus (System SettingsDisplay in KDE). You'll need to enter the root password when prompted.

If you don't have a working graphical display, or you've booted into character mode (see Lab 4.5, "Using Runlevels"), you can start this program from the command line:

$ system-config-display
You are attempting to run "system-config-display" which requires administrative
privileges, but more information is needed in order to do so.
Password for root: 
                  secret

The graphical display will be started in a very basic mode so that the graphical configuration dialog can be displayed.

system-config-display uses the existing display configuration as a starting point. If the existing configuration does not work at all, you may need to delete it to force system-config-display to start from scratch:

# rm /etc/X11/xorg.conf
               


Whether started from the menu or the command line, the window shown in Figure will be displayed.

system-config-display window


This dialog has three tabs:


Settings

Selects the default resolution and color depth for the system. The maximum display resolution is limited by the monitor setting on the Hardware tab; the color depth should almost always be set to "Millions of Colors," which enables 24-bit color.


Hardware

Selects the monitor and video card type installed in your system. The Anaconda installer will have preselected the best match in most cases, but in some display configurationsincluding those with keyboard-video-mouse (KVM) switches, video splitters, or old monitorsthe monitor type cannot be determined automatically. If your monitor does not appear on the list, select the closest option from the Generic CRT or Generic LCD categories.

In most cases, the exact video card model is not important; it's the chipset that counts. From your video card documentation, find out the chipset manufacturer and model (such as NVIDIA GeForce 4 MX) and select that option from the list. In many cases, an exact match is not required because one video driver is used for a wide range of chipsets.

If there are no options that work for your video card, select the VESA driver, which will provide basic capabilities on almost any modern video card.



Dual head

The X.org server used in Fedora can drive multiple monitors. If you have a second monitor connected to a second video card, you can enable it here. Select the checkbox labeled "Use dual head," then specify the video card, resolution, and color depth to be used. You can also specify the desktop layout as "Individual desktops" or "Spanning desktops"; for most applications, "Spanning desktops" is most versatile, since it enables you to move windows between desktops or even have a window fill both desktops. The second monitor is assumed to be to the right of the primary monitor.

Once you have selected the desired configuration, click OK. The new configuration will take effect the next time you start the graphical user interface.

If you logged in graphically, the GUI won't restart until you restart the system. You can force it to restart sooner by pressing Ctrl-Alt-Backspacebut you will lose any unsaved data, so exit from all applications first. (This key sequence abruptly aborts the X server process and normally should not be used to exit from a graphical session).


How Does It Work?

system-config-display changes the X server configuration file, /etc/X11/xorg.conf. If necessary, it creates an entirely new file. Most of the information for this file is determined from the hardware by probing.

The xorg.conf file contains configuration information for four types of devices:

  • Video card

  • Monitor

  • Keyboard

  • Pointer (typically a mouse, but possibly a trackball, graphics tablet, touch screen, light pen, or some other positional input device)

The xorg.conf file is a plain-text file and can be edited by hand (see Lab 4.4, "Basic Text Editing Using vi"). Be sure to make a backup copy before making any changes. You can find a detailed description of the configuration options in xorg.conf's manpage (see Lab 4.2, "Accessing Online Documentation"):

$ man xorg.conf
            

The file is divided into sections, each of which looks like this:

Section "SectionName"
    Configuration Directives
EndSection

The most commonly used sections in this file are shown in Figure.

Common xorg.conf section names
NameDescription
                              Monitor

Monitor specifications.
                              InputDevice

Keyboard configuration.
 Pointer device configuration (mice, graphics tablets, touch screens).
                              Device

Video card configuration.
                              Screen

Associates a Device with a Monitor and defines the available resolutions and color depth.
                              ServerLayout

Associates one or more Screen sections with two or more InputDevice sections. Different ServerLayouts can be defined to combine devices in different ways for use at different times; for example, a laptop can have a ServerLayout that specifies that the internal+external displays should be used, and another one that specifies only the internal display.
                              Files

Location of auxiliary files such as fonts, drivers, and color tables.
                              ServerFlags

Flags to control the overall operation of the X server. The flags may alternatively be placed in the ServerLayout sections if they apply to some ServerLayouts but not to others.
                              Extensions

Enables/disables extensions to the server capabilities.
                              Module

Loads additional modules. (Modules may provide extensions, but extensions don't have to exist as separate modules.)
                              Modes

Defines special video modes (rarely required).
                              DRI

Direct Render Interface (DRI) device configuration, used for some 3-D gaming.


Here is a typical xorg.conf file:

Section "ServerLayout"
        Identifier     "single head configuration"
        Screen      0  "Screen0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "Synaptics" "CorePointer"
        InputDevice    "Mouse0"    "AlwaysCore"
EndSection

Section "Files"
        FontPath     "unix/:7100"
EndSection

Section "Module"
        Load  "glx"
        Load  "dri"
        Load  "synaptics"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Device" "/dev/input/mice"
        Option      "Protocol" "IMPS/2"
        Option      "ZAxisMapping" "4 5"        # Scrollwheel support
        Option      "Emulate3Buttons" "yes"     # L+R buttons count as middle
EndSection

Section "InputDevice"
        Identifier  "Synaptics"                # Laptop touchpad
        Driver      "synaptics"
        Option      "Device" "/dev/input/mice"
        Option      "Protocol" "auto-dev"
        Option      "Emulate3Buttons" "yes"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"        # Just for reference
        ModelName    "LCD Panel 1400x1050"   # Just for reference
        HorizSync    31.5 - 90.0             # Horiz. sync in kHz
        VertRefresh  59.0 - 75.0             # Vert. refresh in Hz
        Option      "dpms"                   # Enables power management
EndSection

Section "Device"
        Identifier  "Videocard0"
        Driver      "nv"
        VendorName  "Videocard vendor"        # Just for reference
        BoardName   "nVidia Corporation NV34M [GeForce FX Go5200]"  # Ditto
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"              # Associates the video card
        Monitor    "Monitor0"                # with this monitor
        DefaultDepth     24                  # Default is 24-bit colour
        SubSection "Display"
                Viewport   0 0               # "0 0" is almost always used
                Depth     24                 # This section used by default
                Modes    "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
                                        # Change modes with Ctrl-Alt-+/-
        EndSubSection

# This next SubSection is not selected by default (because of the
# DefaultDepth line in the previous section). However, it would be used if the 
# -depth option was specified on the X server command line, 
# overriding the DefaultDepth setting.

        SubSection "Display"
                Viewport   0 0
                Depth     16                    # Because default is 24-bit,
                Modes    "800x600" "640x480"    # ...this will usually be ignored
        EndSubSection

EndSection

Section "DRI"                                # Configures DRI devices...
        Group        0                       # Root (user ID 0) owns them
        Mode         0666                    # Readable/writable by all
EndSection

Section "Extensions"
        Option "Composite" "Enabled"        # Enables transparency, etc.
EndSection

To change the default color depth, edit the DefaultDepth line in the Screen section (make sure that a SubSection for that depth exists in the Screen section of the file). Values that work with most video cards include 8, 16, and 24 bits; the number of colors available is 2depth.

Similarly, the default resolution is controlled by the Modes entry in SubSection "Display" with the same Depth as DefaultDepth.

For example, to change the configuration in this example from a 24-bit (16-million-color) to 16 bit (65,536 color) depth, and to change the resolution to 800x600, change the DefaultDepth to 16 and then change the Modes line in the SubSection for 16-bit color:

Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"              # Associates the video card
        Monitor    "Monitor0"                # with this monitor
        DefaultDepth     16
                                    # Default is 16-bit colour
        SubSection "Display"
                Viewport   0 0               # "0 0" is almost always used
                Depth     24                  # This section used by default
                Modes    "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
                                        # Change modes with Ctrl-Alt-+/-
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
                Modes    "800x600"
        EndSubSection
EndSection

The Composite extension, enabled in the Extensions section of the file, powers the use of advanced visual effects, including transparency. Not all video drivers support Composite.

What About...

...per-user display resolution settings?

The GNOME menu option SystemPreferencesScreen Resolution sets the default resolution and refresh rate for a particular user (in KDE, select Control Center from the panel menu, then click on Display under Peripherals; be sure to select the checkbox labeled "Apply settings on KDE startup").

The system-wide resolution setting will be used for the user login display; individual user settings will take effect after the user logs in. The color depth can't be set this way because the architecture of the X Window System requires the color depth to be a system-wide setting.

...creating the xorg.conf file without using system-config-display?

The X server itself is capable of generating a reasonable xorg.conf file, which you can then fine-tune by manually editing it:

# X -configure :1
               

The system will automatically start an X server using display number :0. Additional X servers can be started as long as they each use a unique display numberwhich is why :1 was used in this command.


The new configuration file will be placed in /root/xorg.conf.new. In order to use it, you'll need to link the name /dev/mouse to the default mouse device:

# ln -s /dev/input/mice /dev/mouse
               

You can then test the new configuration:

$ X -config /root/xorg.conf.new
               

This will present a blank display with an X-shaped mouse pointer. If the display looks right and you can move the pointer with your mouse, then go ahead and install this new configuration file as the default configuration:

# mv /root/X11/xorg.conf /root/X11/xorg.conf.backup
# mv /root/xorg.conf.new /etc/X11/xorg.conf
               

You can fine-tune this configuration either manually or by using tools such as system-config-display.

...using multiple mice and keyboards with one display?

The default X server configuration will work with all USB pointer devices and keyboards plugged into the system. The devices will work in parallel; for example, if you have two mice, moving either one will move the onscreen pointer, and if you have two keyboards, typing on either will send characters to the display.

Most keyboards will be detected as soon as they are plugged in, but other keyboards will be detected only when the system starts. For example, I have a secondary French Canadian USB keyboard and a USB calculator/numeric keypad; the French Canadian keyboard is detected as soon as it is plugged in, but the numeric keypad must be plugged in during boot in order to be detected properly. Special features of advanced pointers (such as touchpads) will not be configured automatically unless those devices are plugged in when system-config-display is run.

...a nonstandard monitor, such as a widescreen laptop display?

In most cases, these displays can be probed automatically using VESA standard protocols. If not, edit /etc/X11/xorg.conf, find the Monitor section, and enter the HorizSync (horizontal scan frequency) and VertRefresh (vertical scan/refresh frequency) values specified in your monitor documentation:

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Unknown Monitor"
        HorizSync    32.00 - 72.0               # Horiz. sync in kHz
        VertRefresh  58.0 - 62.0                # Vert. refresh in Hz
EndSection

Next, edit the default resolution to match your hardware:

Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0
        Monitor    "Monitor0"
        DefaultDepth      24
        SubSection "Display"
                Depth     24
                Modes     "1280x800"
        EndSubSection
EndSection

Where Can I Learn More?

  • The manpages for X (general information about the X Window System), Xserver (general information about the X window server), Xorg (specific information about the X.org version of the Xserver used in Fedora Core), and xorg.conf (information about the X server configuration file).



 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows