DISCLAIMER. English language used here only for compatibility (ASCII only), so any suggestions about my bad grammar (and not only it) will be greatly appreciated.

понедельник, 31 января 2011 г.

Notes for XFree86 Video Timings howto

Some typo in Chapter 11.2 in time to ticks conversion formulas

   Should be

        VR = VAT * HSF (but not VSF!);
        (VFL - VR) = VBT * HSF (but not VSF!);


Definition notes {{{

    dot clock tick = horizontal tick
    dot = raster dot

        All four terms used here interchangeable. Though dot clock tick
        generally refers to time needed to process (draw?) one dot, here it's
        also used to measure horizontal scan line length: we take scan line
        length as number of dot clock ticks passed until monitor have finished
        to draw it.

    scan line tick = vertical tick
    scan line

        These three terms here also used interchangeable. Scan line tick is
        time needed to process (draw?) one horizontal scan line, but it's also
        can be used to measure vertical screen length.

}}}
Frames and frequencies (in ticks) {{{

    DCF = RR * HFL * VFL, (RR == VSF)
    DCF = HFL * HSF
    HSF = VFL * VSF

    where {{{

        DCF (driving clock frequency / dot clock frequency)

            Number of dots (pixels) per second video adapter can emit.  DCF
            should match to monitor's video bandwidth - higher DCF will have
            no effect.

        RR  (refresh rate)

            Number of times per second entire screen is repainted.  (RR is the
            same as VSF);

        HSF (horizontal sync frequency)

            Number of times per second the monitor can write a horizontal scan
            line (HFL dot clock ticks in length).

        VSF (vertical sync frequency)

            Number of times per second the monitor can write a full screen
            (VFL scan line ticks in length). (The same as RR);

        HFL (horizontal frame length)

            Number of dot clock ticks needed for monitor to scan one
            horizontal line, including the inactive left and right borders;

        VFL (vertical frame length)

            Number of scan line ticks needed for monitor to scan entire
            screen, including the inactive top and bottom borders;

    }}}

    On the one hand, HFL is simply number of dots in one horizontal scan line
    and VFL is simply number of scan lines in the entire screen. But we know
    time required to scan one raster dot (duration of one dot clock tick)

        (1 / DCF),

    and time required to scan one horizontal line (duration of one scan line
    tick)

        (1 / HSF)

    so we also can represent HFL and VFL in seconds (see below).

}}}
Sync pulses (in ticks) {{{

    HFL = HR + HGT1 + HSP + HGT2
    VFL = VR + HGT2 + VSP + VGT2
    HB  = HGT1 + HSP + HGT2
    VB  = VGT1 + VSP + VGT2

    where {{{

        HR (horizontal resolution)

            Number of visible horizontal ticks (dot clock ticks). Or simply
            number of visible raster dots;

        VR (vertical resolution)

            Number of visible vertical ticks (scan line ticks). Or simply
            number of visible horizontal scan lines;

        HGT1 (horizontal guard time 1)

            Number of dot clock ticks to wait before sending HSP;

        HSP (horizontal sync pulse)

            Length in dot clock ticks of horizontal sync pulse;

        HGT2 (horizontal guard time 2)

            Number of dot clock ticks between end of HSP and end of horizontal
            frame;

        VGT1 (vertical guard time 1)

            Number of vertical ticks (scan lines) to wait before sending VSP;

        VSP (vertical sync pulse)

            Length in vertical ticks (scan lines) of vertical sync pulse;

        VGT2 (vertical guard time 2)

            Number of vertical ticks (scan lines) between end of VSP and end
            of vertical frame;

        HB (horizontal blanking)

            Length of horizontal blanking interval (see below) in dot clock
            ticks.

        VB (vertical blanking)

            Length of vertical blanking interval (see below) in scan line
            ticks.

    }}}

    HGT1 (VGT1) also called Front Porch and HGT2 (VGT2) - Back Porch.
    Horizontal (vertical) blanking interval - is interval, when beam turned
    off. It consists from three phases: Front porch, Sync pulse, Back porch.
        - Front porch - the beam is black (== blank) and still moving right
          (past the end of the visible part of scan line, but still at the
          same scan line);
        - Sync pulse  - the beam is blacker than black and rapidly moving from
          right physical screen edge to the left to start scan next line;
        - Back porch  - the beam is black (== blank) and moving right again
          (already at the next (now current) scan line, but before the start
          of its visible part);

    Hence, actually what we call horizontal frame locates on two scan lines,
    but if we map all its parts onto one line, they will not overlap. Here is
    illustration:

                        time
    ------------------------------------------------------------------>

     | Scan line N           | Between    | Scan line (N + 1)
     |                       | scanlines  |
     |                       |            |
    >> HR        >> Front   >> sync      >> Back    >> HR        >> ..
    >>           >> porch   >> pulse     >> porch   >>           >> ..
    >> (visible) >> (black) >> (blacker) >> (black) >> (visible) >> ..
     |                                               |
     |      Horizontal frame N                       |


    and here is another one illustration:

                  |      HR (visible) || Front   | 
                  |                   || porch   | 
                  |                   || (black) | 
      R           =====>=====>======>==___>___>___R
      R                                          /R - sync pulse,
      R ..<.........<.........<.........<........ R - move beam to the left
      R/                                          R - (blacker than black)
      R___>___>___=====>                          R
       | Back    |
       | porch   |
       | (black) |

    where

        =       Beam turned on, visible ticks.
        _       Beam turned off, black.
        .       Beam turned off, blacker than black.
        R       Physical screen borders.
        <       Beam moving to the right.
        >       Beam moving to the left.

}}}
Frames and syncs in seconds {{{

    HR = HAt * DCF
    HB = HBt * DCF

    VR = VAt * HSF
    VB = VBt * HSF

    HFL = HFt * DCF
    VFL = VFt * HSF

    where {{{

        HAt (horizontal active time)

            Time (in seconds) needed by monitor to scan HR raster dots.  Or,
            in other words, time required for HR dot clock ticks.

        VAt (vertical active time)

            Time (in seconds) needed by monitor to scan VR scan lines.  Or, in
            other words, time required for VR scan line ticks.

        HBt (horizontal blank time)

            Time (in seconds) needed for HB dot clock ticks.

        VBt (vertical blank time)

            Time (in seconds) needed for VB scan line ticks.

        HFt (horizontal frame time)

            Time (in seconds) needed for HFL dot clock ticks.

        VFt (vertical frame time)

            Time (in seconds) needed for VFL scan line ticks.

        }}}

}}}
Common notes {{{

    HFL is overall number of raster dots in one horizontal frame, or, in other
    words, in the one horizontal scan line. But the screen physical dimensions
    are constant, though HFL (as well as HR) may vary. So, physical length (in
    milimeters) of one raster dot depends from overall number of raster dots in
    horizontal frame, i.e. depends from HFL.  If we increase HFL, then physical
    length of one raster dot will decrease, and, hence, with constant HR,
    physical length of visible area will decrease and black margins will
    increase. And vice versa: if we decrease HFL, then physical length of one
    raster dot will increase, and, hence, with constant HR, physical length of
    visible part of horizontal frame will increase and black margins will
    decrease.

    Duration of Front porch controls the size of right black margin.  Duration
    of Back porch controls the size of left black margin.

    Hence, to move image to the right (left), we should move sync signal
    relative to HB interval to the left (right), effectively changing front
    and back porches.  To squeeze (stretch) image in both (right/left or
    up/down) directions (with constant HR or VR) we should change HFL (VFL)
    and move sync signal in the same relative position in the HB interval, as
    it was before, effectively changing raster dot physical length, and hence
    area occupied by visible part of horizontal (vertical) frame.  To change
    all four visible area's dimensions (with constant RR), we should change
    DCF, effectively changing (HFL * VFL) product.

}}}

Комментариев нет:

Отправить комментарий