Chapter 5. Modeline Support

Standard display devices could be lighted by EDID (Extended Display Identification Data) or built-in timing. But regarding to those non-standard display devices which fails to use the timing provided by EDID or the built-in timing, the only way is to use the modeline.

However, you could use the specified timing by modeline to light the display device, even it has the EDID or the built-in timing works on it. Comparing to EDID and the built-in timing, the modeline has higher piority.

Generally, modeline is utilized for CRT/LCD/DVI. HDMI monitor need a precise PLL clock to meet CEA’s requirement, so HDMI need to use built-in timing.

To use modeline, you should do the following steps,

1. Add the modeline in the related Monitor section. For example,

Modeline "1024x600_60" 50.4 1024 1048 1184 1344 600 603 604 625 -HSync +VSync

The mode description is in four sections, the first three of which are mandatory. The first is the dot (pixel) clock. This is a single number specifying the pixel clock rate for the mode in MHz. The second section is a list of four numbers specifying the horizontal timings. These numbers are the hdisp, hsyncstart, hsyncend, and htotal values. The third section is a listof  four numbers specifying the vertical timings. These numbers are the vdisp, vsyncstart, vsyncend, and vtotal values. The final section is a list of flags specifying other characteristics of the mode. Interlace indicates that the mode is interlaced. DoubleScan indicates a mode where each scanline is doubled. +HSync and -HSync can be used to select the  polarity of the HSync signal. +VSync and -VSync can be used to select the polarity of the VSync signal. Composite can be used to specify composite sync on hardware where this is supported. Additionally, on some hardware, +CSync and -CSync may be used to select the composite sync polarity. 

There are several VESA standards to calculate the timing table, i.e. CVT, GTF, DMT.

The string after Modeline is usually defined after the mode plus the refresh rate. But regarding to LCD panel, there is a special setting besides this format. The string after Modeline is "PanelMode". This function is similar to Option "PanelSize", but it has a detailed timing. It aims to support the special panel timing not listed at the panel mode table. Once you set PanelMode, the driver will use the defined timing to light the LCD panel in a mandatory way. And if you set PanelMode, you would not set PanelSize, since the priority of PanelMode is higher than EDID and PanelSize. For example,

Section "Monitor"
        Identifier      "LCD"
        Modeline "PanelMode"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
EndSection

2. Set PreferredMode in the related Monitor section

Take LCD panel for example, to use the PanelMode defined above, you should set it to be the PreferredMode in the Monitor section of LCD.

Section "Monitor"
        Identifier      "LCD"
        ......
        Modeline "PanelMode"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
        Option	"PreferredMode"	"PanelMode"
EndSection 

Or you can use the specified modeline like this,

Section "Monitor"
        Identifier      "LCD"
        ......
        Modeline "1024x600_60"    50.4 1024 1048 1184 1344 600 603 604 625 -HSync +VSync
        Option	"PreferredMode"	"1024x600_60"
EndSection

You're allowed to add more than one Modeline in a Monitor section, but only the one afterPreferredMode will be used. When using XRandR extension, you could apply a user specified modeline to each display device.