Linux Modeline mini-HOWTO (part 1/1)

Linux Modeline mini-HOWTO (part 1/1)

Post by Rick Nile » Fri, 01 Dec 1995 04:00:00

Archive-name: linux/howto/mini/modeline
Last-modified: 22 Feb 95


*** The `Linux Modeline mini-HOWTO' is posted automatically by the
*** Linux HOWTO coordinator, Greg Hankins <>.  Please
*** direct any comments or questions about this HOWTO to the author,
*** Rick Niles <>.

- --- BEGIN Linux Modeline mini-HOWTO part 1/1 ---

- -------------------------------------------
  ModeLine-HOWTO by Rick Niles.
- -------------------------------------------
  Version 1.0   2/11/95
- -------------------------------------------

The file X11R6/lib/X11/doc/VideoModes.doc explains how to setup video
timings for your video card / monitor combination, however I found
this to be a long overly complicated explanation of something really
not that complex.  Please let no one take offense at this, since
without this file I don't think I would ever have figured out how to
configure my setup and I am therefore very thankful to the writers of
that document. I just thought I would give my shortened explanation of
how to setup your XF86Config file for XFree86 and in particular
information about the Mach64 timings I've played with.

There are three major sections of the XF86Config file that deal with
the video card and monitor: the monitor section, the graphics device
section and the screen section. Ironically the timings I'm discussing
in this document concentrate on Monitor section even though I use
many specs from the video card.

In regard to the graphics device section I suggest commenting out any
"Clocks" given in the file when setting up a new server and/or video
card and let "X -probeonly" determine what Clocks are good for your
card / server combination.  I recommend this above just putting in the
numbers given in the manual because exact timings on cards will vary.
Redirect this information into a file and copy it into the XF86Config

Now the hard part about setting up a XF86Config file is the
definitions of the Modelines.  For many non-ATI cards these number must
be multiples of 8.  For ATI cards they need NOT be.  There are 10
arguments after each Modeline directive:

Modeline <name> <DCL> <HR> <HPS> <HPE> <HFL> <VR> <VPS> <VPE> <VFL>

 (name) Any name you'd like to assign to this mode, in double quotes.
        The most common name is of the form HRxVR (e.g. "640x480")
        However if you would like to have multiple Dot Clocks for a
        give resolution setting your might try HRxVRxDCL
        (e.g. "640x480x35.0")

 (DCL) Dot Clock: This should be one of the dot clocks listed in the
        manual or found in the Clocks section from the "X -probeonly"

 (HR & VR) Horizontal and Vertical Resolution: This also an easy one, it's
           the number pixels you want to see across and down the
           screen when you're in this mode.

 (HPS, HPE, VPS, VPE) Hortz. & Vertical Pulse Start and End: This
           controls where the image of the screen will be placed
           relative to the physical screen.  These are the numbers to
           play with if the image is biased toward the edges of the
           physical screen.  For starters just make them evenly spaced
           between the resolution numbers (HR,VR) and the field length
           numbers (HFL,VFL).
           If the image is biased toward the left (right), increase
           (decrease) the HPS and the HPE.
           If the image is biased toward the top (bottom), increase
           (decrease) the HPS and the HPE.

 (HFL,VFL) Horizontal & Vertical Field Length: Now these are the most
           important numbers of all.  If you set these numbers too
           low or high for your monitor the XF86 server will reject
           your whole modeline.  The KEY relation to remember is:

              | DCL = HSF * HFL  and DCL = RR * VFL * HFL |

           where HSF = Horiz. Scan Freq.   (kHz)
                 RR  = (Vert.) Refresh Rate (Hz)

These two numbers are given as a valid range for a particular monitor.
Try exceeding the specs and see how far you can go before funny
things start happening.

These two equations give you all the information you need to set up
your Modelines for a particular set-up.  They leave two degrees of
freedom (i.e. two unknowns), for a chosen Dot Clock (DCL).  As HFL and
VFL get smaller, the screen will get wider and taller.  However, you
can not make these values arbitrarily close to the HR and VR since as
they approach these values the HSF and RR will exceed your monitor's
cabilities.  Therefore one way of getting the maximum image size
(hence using the most of your physical monitor's real-estate) for a
particular Dot Clock (DCL) is to plug in the maximum HSF and RR your
monitor is rated for.  If the image is still too small your only option is
to reduce the Dot Clock (DCL) (or try exceeding your monitor specs).
This fact troubled me for sometime as it seems counter-intuitive,
however try to get comfortable with it as it is true none-the-less.

The other way I thought of to resolve the extra degrees of freedom is
to use the video card table given in the manual of my Mach 64.  The
manual gave DCL, HSF, & RR, hence I could solve for VFL & HFL using
the equations above. I thought this might be a good idea since perhaps
in some way the card was "designed" to work at these frequencies, and
hence they make work better in some way. (However, I now seriously
doubt that assumption.) Here is that table:

HFL and VFL values for XF86_Mach64 corresponding to ATI Mach64 Manual

Display Screen  Refresh  Horizon.  Pixel   Horizon.    Vertical  
 Resolution      Rate     Freq.    Clock   Field Len.  Field Len.
 (pixels)        (Hz)     (kHz)    (MHz)   (Pixels)    (Pixels)  
 (HRxVR)         (RR)     (HSF)    (DCL)    (HFL)       (VFL)    
- -----------------------------------------------------------------
 640x 480         60      31.5     25.2      800         525
 640x 480         72      37.7     32.0      849         524
 640x 480         75      37.5     35.0      933         500
 640x 480         90      47.9     39.9      833         532
 640x 480        100      53.0     44.9      847         530
 800x 600         48      33.8     36.0     1065         704
 800x 600         56      35.2     36.0     1023         629
 800x 600         60      37.9     39.9     1053         632
 800x 600         70      44.5     44.9     1009         636
 800x 600         72      48.0     50.4     1050         667
 800x 600         75      49.5     49.5     1000         660
 800x 600         90      57.1     56.6      991         634
 800x 600        100      62.5     67.5     1080         625
1024x 768         43      35.5     44.9     1265         826
1024x 768         60      48.3     65.0     1346         805
1024x 768         70      56.5     75.0     1327         807
1024x 768         72      58.2     75.0     1289         808
1024x 768         75      60.0     78.8     1313         800
1024x 768         90      76.2    100.0     1312         847
1024x 768        100      79.0    110.0     1392         790
1152x 864         43      45.9     65.0     1416        1067
1152x 864         60      59.0     80.0     1356         983
1152x 864         70      66.1    100.0     1513         944
1152x 864         75      75.1    110.0     1465        1001
1152x 864         80      80.0    126.0     1575        1000
1280x1024         43      50.0     80.0     1600        1163
1280x1024         47      50.0     80.0     1600        1064
1280x1024         60      64.0    110.0     1719        1067
1280x1024         70      74.0    126.0     1703        1057
1280x1024         75      80.0    135.0     1688        1067

- --- END Linux Modeline mini-HOWTO part 1/1 ---

Version: 2.6.2
Comment: finger for public key