NeddySeagoons' Rough Guide to Xorg Modelines
Why do you need a modeline (or more than one modeline) ?
Xorg comes preprogrammed with most of the standard VESA graphics modes. At the moment, they all produce a 4:3 aspect ration image.
More users are installing wide screen hardware and want to use all of their display surface, without cropping or bars at the side.
Xorg can generate almost any arbitary resolution and refresh rate you would like, you only need describe to Xorg how to do it.
This is what the modeline does. It has the form
Code: Select all
ModeLine "name" DotClock hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal Flags HSkew VScan
For most users
can be omitted and will not be covered further here. If you need a mode line for TV-Out, read man xorg.conf. You will need to set interlace, at least, which is one of the flags.
Using 1360x768@60 Hz as an example, we can fill in
Code: Select all
ModeLine "1360x768@60" DotClock 1360 hsyncstart hsyncend htotal 768 vsyncstart vsyncend vtotal
Thats the easy bit.
The name is arbitary but must be unique. We need to use it to refer to the modeline later. Use of descriptive nanes is encoraged.
The rest of the numbers are difficult to calculate buy hand but there are a number of modeline generators on the web. I have used
this one to contine the example.
Filling in the basic configuration and pressing calculate gives
Code: Select all
Modeline "1360x768@60" 84.50 1360 1392 1712 1744 768 783 791 807
Note that this requires a
Code: Select all
Horizontal sync frequency: 48.45 kHz
Check that this is within the range accepted by your display.
Now we have out modeline, what do we do with it ?
I recommend adding it to your
in /etc/X11/xorg.conf for the display that it will be applied to. This prevents it being used with other displays if you have several attached. Like this
Code: Select all
Section "Monitor"
Identifier "CTX 950ST"
VertRefresh 50.0 - 160.0
HorizSync 30.0 - 95.0
Modeline "1360x768@60" 84.50 1360 1392 1712 1744 768 783 791 807
Option "dpms"
EndSection
Your section "Monitor" will be different to mine - its just an illustration.
Thats defined the modeline to Xorg, to actually use it we need to edit the Section "Screen" too.
Code: Select all
Section "Screen"
Identifier "Screen 1"
Device "NVIDIA GeForce"
Monitor "CTX 950ST"
DefaultDepth 16
Subsection "Display"
Depth 16
Modes "1360x768@60" "1024x768" "800x600" "640x480" "512x384" "416x312" "400x300" "320x240"
ViewPort 0 0
EndSubsection
EndSection
The first Identifire in the Modes statement ("1360x768@60") is our new widescreen mode, which is what Xorg will use at startup.
Again its an illustration based on my xorg.conf - yours will differ.
For most users, this will 'Just Work' but if the HorizSync or VertRefrsh is very close to the limits of your display, the rounding the Xorg does can push the Modeline setting over the boundary.
You fix that by going back to the modeline generator, deleteing the refresh rate and making a small (0.1) change to the pixel clock and recalculating the mode line. Put the new numbers in the modeline statement and try again.
You may define and use further modelines in the same way.