15. How do I convert XFree86 mode-lines into framebuffer device timings?

If you have XFree86 (X11) installed on your machine, and you can use it successfully, it is a simple matter to convert the mode-lines in your XF86Config file to the required timings needed by the framebuffer devices.

The framebuffer device requires the following fields:

An XFree86 mode line has the following fields:

It is necessary to do some simple calculations to translate the XF86 mode-lines into a set of framebuffer device timings. As an example, we shall examine how to convert a mode-line taken from my XF86Config file:

First, calculate the required pixclock rate. XFree86 uses megahertz whilst framebuffer devices uses picoseconds (Why, I don't know). Divide one million by DCF. For example: 1,000,000 / 110.0 = 9090.9091

Now we need to calculate the horizontal timings:

In our example, this would be:

And now we need to calculate the vertical timings.

For our example, this would be:

Now we can use this information to set up the framebuffer for the desired mode. For example, for the matroxfb framebuffer driver, it requires the following:

I put into my /etc/lilo.conf the following line:

Note that in this case the pixel clock isn't used. It's only necessary if you don't like the default pixel clock rates. You can supply this as a parameter as well. Setting the pixclock is documented in other parts of this HOWTO.