XFree86 Modeline
From Wikipedia, the free encyclopedia
A modeline is a configuration line in the XFree86 configuration file (XF86Config) that provides information to the X server about a connected computer monitor or television and how to drive it at a specified display resolution.
Modelines may no longer be necessary in XFree86 versions 4 and higher, since for many monitors and HDTVs they are now calculated by the X server at startup based on two factors:
- other, more generic and intuitive, settings in the server configuration file
- monitor capabilities acquired via an EDID query
EDID is not always completely accurate, and for some situations such as older or unusual display hardware or many HDTVs, it will be necessary to create a modelines to get the setting perfect. The EDID information can be obtained by using the command "startx -- -logverbose 5" and looking at /var/log/XFree86.0.log.
An individual modeline has ten parameters, beginning with a label for the resolution being specified. The second parameter specifies the rate of the pixel clock in megahertz. Then follow four numbers that together specify the x-resolution (width) and related parameters, and four numbers that specify the y-resolution (height).
Modeline "1600x1200" 155 1600 1656 1776 2048 1200 1202 1205 1263 # (Label) | (x-resolution) (y-resolution) # | # (pixel clock rate)
Or, the modeline can be split into more than one line for greater clarity
Modeline "1600x1200" 155 1600 1656 1776 2048 1200 1202 1205 1263
The numbers after the width and height are used to determine the front porch, sync pulse, and back porch timings. The resulting refresh rate of the display can be determined by dividing the pixel clock frequency by the product of the horizontal and vertical field lengths. In this case, the display is operating at 155,000,000/(2048*1263)=59.92 Hz.
Optionally, extra parameters for controlling horizontal and vertical synchronization can be added. There are also options for interlaced and doublescan modes. In most situations they will not be required.