Xfree video timings (tech)

From: Michele Andreoli (m.andreoli@tin.it)
Date: Sun Jan 07 2001 - 22:47:01 CET


Being without my computer, I'm reading the notoriuos
Xfree-Video-Timings-HOWTO, by Eric S. Raymond. Hey, boys: to deal with
horizontal syncpulses, bandwith, micro-seconds, MHz, dot-clocks and
vertical refresh rate is matter of a degree in electric engeneering at
Caltech!

I spent some hour drawing plot charts, trying to understand what a xfree
'modeline' currently is.
The result is this work is the little awk script in attachment, but I'm
still working on it.
The number of uncontrained variables is very high, when talking with
video mode.

The script is able to generate a 'more dense' set of modeline, for
common resolutions such
640x480, 800x600 and 1024x738.

Typing:

            # mode > mode.line

you can try to put the content of the generated file "mode.line" in the
Section Monitor in
Xf86Config. Fortunately, X discard any modeline out-of-range, so you can
generate
hundred-and-hundred of modeline entry, in the purpose of test/probe.

The "mode" script requires a rang of clocks (in Mhz): for example "mode
20 70" scans
any dot-clocks from 20->70 Mhz, step=1. Having a Matrox, you can go
until 120 Mhz.
It generate modelines for any applicable /clock/hsync/vertical refresh/.

You can obtains a guess for dot-clock, running:

                            # /usr/X11R6/bin/XF86_VGA16 -probeonly

(similar for SVGA) and exploring the result messages.

Why doing this effort? Because the SVGA requires more procise modelines,
compared to VGA16:I usually get a lot of failures with the SVGA server,
using only standard modelines.

My idea is to put all that in a rustic-superprobe script, able to
generate a set of suitable
modelines, either for VGA16, either for SVGA.

The problem is: how to test that on a variety of computers? Can someone
help me
experimenting with this script?

Michele


#!/usr/bin/muawk
# (rustic) Xfree modeline generator
# (C) 2001, m. Andreoli for MuLinux

# Based on info extracted reading the
# Xfree86-Video-Timing-HOWTO, by Eric S. Raymond

BEGIN {
        n=split(arg,opts)
        a1=1.3; a2=1.05;
        A=1.65; B=7.3e5;
        a=4.0/3.0; # aspect ratio

        fh1=20; fh2=70
        fv1=47; fv2=100
        if ( opts[1] == "-h" ) {
                printf("XFREE86 Modeline Rustic Computing - M.Andreoli\n");
                printf("Usage: mode min-clock max-clock\n");
                printf("Example: mode 20 70\n");
                exit
        }

        if ( n!= 0 ) {
        fh1=opts[1]; fh2=opts[2];
        fv1=opts[3]; fv2=opts[4]
        }

        modeline(640,480,fh1,fh2);
        modeline(800,600,fh1,fh2);
        modeline(1024,768,fh1,fh2);
        }

function modeline(h,v,min,max)
{
R=h*v;
vmin=fh1*B/R
vmax=fh2*B/R
printf("# *** NOTE: These modes spans VertRefresh in %d-%d .\n",vmin,vmax)
for (f0=min; f0<=max; f0=f0+1) {
f=f0*B/R
fh=f0/sqrt(A/B*R)

status="ok"
if ( f < 60.0 ) { status="low refresh-rate!" }

 printf("# RefreshRate=%2.0f Hz, \
hsync=%4.1f kHz, clock=%4.1f Mhz - [%s]\n", f,fh,f0,status);
 printf("Modeline \"%s\" %4.1f %s\n",h "x" v, f0,\
 timing(h,v,f0));
}
}

# il timing orizzontale dev'essere multiplo di 8
# norm "normalizza" al multiplo di 8 piu' piccolo

function norm(x)
{
r=x % 8;
return x-r;
}

function timing(h,v,f0)
{
# horiz timings

h0=norm(int(h*a1))
n=h0/8
h1=h+int(n*0.03)*8
h2=h1+int(n*0.12)*8

# vert timings
tick=h0/f0 # durata di una riga (in us)
k=int(150/tick) # ticks corrispondenti ad un impulso di 150 us

v0=int(a2*v);
v1=v+1;
v2=v1+k;
b=" "
return h b h1 b h2 b h0 b b b v b v1 b v2 b v0;
}


---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:17 CET