High Resolution X-Windows Newbie HowTo


How to generate the video timing Modelines needed by XFree86.
by Robert Vecchiolli

Ok, so here I am nice and happy with my system displaying X-Windows at 1280x1024x32bpp. Then it occures to me; my video card can handle 1600x1200x32bpp and so can my monitor. So, why am I sitting here in this lower resolution? Well, the only reason I could think of was that XF86Setup would only let me choose from monitors that could only go up to 1280x1024, and I couldn't put my own parameters into the config tool to setup my monitor.

So, what am I supposed to do? Well, being the 'brave soul' that I am I decide to start looking around in my /etc/XF86Config file. From looking in there I couldn't find enough info to do what I wanted, but I did find a reference to a "VideoModes How-To" that gets distributed with X-Win. Ok, enough is enough, it is time for to get down to the nitty gritty on what I did. Oh, yeah we'll need a calculator handy too.

For a list of definitions click the following link
Definition List

**THE FOLLOWING PROCEDURE HAS THE POTENTIAL TO DAMAGE YOUR HARDWARE**
So, procede with much caution.


1) We need our owner's manuals for both our vid card and our monitor (these are a must because there is some information that you'll need from there)

2) We need to look up in both of our manuals to make sure that both devices will perform as desired. This step is important, we must note the max scan rates of our monitor and the scan rates that our video card uses for the resolution that we want to run. If they both "jive" (i.e. the video card uses horizontal and vertical scan rates lower than our monitors max hor. and vert. scan rates) with each other, then we're in business and ready to continue.

3) XF86Config wants a number of parameters in under the Section "Monitor" area in order to display X on your monitor. The area under Section "Monitor" that we are concerned with at the moment are the lines that start with Modeline. On the lines that are already there you will see a bunch of numbers. I'll get to what they are a little later.

4) Get out a blank sheet of paper and make up a table that is made up of 2 rows of 10 cells. Like this:

Namedothorsyssyehorevertsyssyeverte
..........

In the cell under "Name" put the desired resolution that you want to run. under "dot" put your monitor's "Video bandwidth" (in my case it's 135(the units don't matter we just want the number)), under "hor" put the horizontal size of the desired resolution, leave "sys", "sye" and "hore" blank for now. under "vert" place the vertical resolution you want in there and leave the rest of the cells empty for now.

Namedothorsyssyehorevertsyssyeverte
"1600x1200"1351600...1200...

5) get out that calculator. we are going to calculate "hore" now. to do that you take "hor" (1600) and divide it by .8. For this example that gives us 2000. Your number maybe different if you are using a different resolution. If that number that we just calculated is evenly divisible by 8 (i.e. if you divide 2000 by 8 and have no remainders) go ahead and put it in the slot under "hore". If your number is not evenly divisible by 8 then round it down to the nearest number that is. (i.e. if you number is 1887 you would round it to 1880) Once you have it rounded to a nice number that 8 can go evenly into, then go ahead and put your number into the "hore" slot.

hore=hor÷.8
hore=1600÷.8=2000 **2000 is evenly divisible by 8

6) Now for "verte". to calculate "verte" you take the number in "vert"(1200) and multiply it by 1.05 (1200 x 1.05). If that answer is a multiple of 8 then stick it in "verte". If not, then we'll have to round it down.

1200x1.05=1260
1260÷8=157 r 4 **not a multiple of 8 so now we round it down
1256÷8=157 **no remainder so we're can stick 1256 into "verte"

now we should have:

Namedothorsyssyehorevertsyssyeverte
"1600x1200"1351600..20001200..1256

7)Now to fill in the rest of the data. for the 2 cells between "hor" and "hore" we just do some simple addition:

sys=hor+32
sys=1600+32=1632 **so we put 1632 into the "sys" cell next to "hor"
sye=hore-32
sye=2000-32=1968 **so we put 1968 into the "sye" cell next to "hore"

8) For the parameters between "vert" and "verte" it's a even easier:

sys=vert+3
sys=1200+3=1203 **so we put 1203 into the "sys" cell next to "Vert"
sye=sys+3
sye=1203+3=1206 **so we put 1206 into the "sye" cell next to "verte"

9) so now our table should look something like this:

Namedothorsyssyehorevertsyssyeverte
"1600x1200"13516001632196820001200120312061256

10)to add this info to your XF86Config file you just have to go to the section labeled Section "Monitor", and create a new line under a current Modeline line and enter your data. It should look something like this now:

Section "Monitor"
    Identifier     "Primary Monitor"
    VendorName     "CTX"
    ModelName     "1785XA"
    HorizSync     31.5-84.3
    VertRefresh     50-120
    Modeline "1280x1024" 110.00 1280 1328 1512 1712 1024 1025 1028 1054
    Modeline "1600x1200" 135.00 1600 1648 1984 2000 1200 1201 1204 1256
EndSection

The line that we added is in bold.

11) Now we need to add the new resolution to the Section "Screen" After you do that it should look like:

Section "Screen"
.
.
.
    SubSection "Display"
    Depth     32
    Modes     "1600x1200" "1280x1024"
    EndSubSection
EndSection

12) Fine tuning, if you find that the display is flickering too much you can go in and increase the value that we put under "dot" (135) by increments of 5 or 4 (mine started at 135 but i had to increase it up to 156 to get a nice flicker-free display). However, you must becareful that you don't increase the number to greater than twice the Bandwidth of your monitor.

Further adjustments, such as centering, can be done with the controls on your monitor or by using the app "xvidtune" if your distribution comes with it.

It took me a couple of hours to get this right, but I was working from a HowTo that I had to sort out all of the important data from. Hopefully it won't take you guys as long.