Re: console.c: scrolling bug found

Riku Saikkonen (rjs@isil.lloke.dna.fi)
Thu, 15 Feb 1996 18:03:40 +0200 (EET)


"Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de> wrote:
>On 14 Feb 96 at 23:24, Riku Saikkonen wrote:
>> This causes the occasional incorrect display in one frame (it is fixed when
>> the video card does the next display refresh since the outb_p()s have then
>> been completed). I guess console switching and scrollback could also cause
>I'm afraid that this might be hardware dependent. Maybe some hardware
>has a latch for the new start address. I've never seen the effect on
>a Paradise VGA, or an ATI VGA Wonder XL. Isn't there also a bit to

Hmm... Maybe. I've seen it happen on two Cirrus cards.

>disable generation of video signals. I remember reading this in the
>IBM specs for their VGA; the text said you could maximize the video
>memory bandwidth that way. Maybe we could use that.

Yes, there are bits for that, but they blank the screen... (And blanking the
screen even for a small interval causes flicker.) I think the same are used
in the normal screen blanking routines. (Unless there are some other bits
than the ones I'm thinking about.)

>> The only way that I can think of to fix this would be to wait until the
>> vertical sync pulse is active (and thus the display adapter isn't doing a
>> refresh) before those outb_p()s. But this would slow down scrolling quite a
>This is very slow from my experience. Maybe horizontal retrace will
>also work, but is is much faster (because it's more frequent).

Yes, vertical refresh is slow, we'd have to wait on average 7-8 ms (in a 60
to 70 Hz refresh mode). Horizontal refresh would be better if the four
outb_p()s are done fast enough (hmm, in under about 10 us on a 31.5 kHz mode).

Hmm. That should be fast enough. And now I'm starting to wonder whether this
really is the cause of the bug. It should appear in only one horizontal
line, not a full screen, as it seems to. Hmm...

Oh yes. Display adapters probably get the starting address from their
registers only once on each refresh (to avoid lots of spurious additions to
the address to get additional lines). If this is correct, we'd need to have
the correct address in the registers at the start of a refresh - which means
that we could change it in the middle of the refresh, but not just before
the display adapter starts a refresh. Thus we'd need to set the registers
anywhere but in the end of the vertical refresh. Which means that we should
probably wait until the _end_ of the vertical refresh pulse (I don't think
there's an easy way to know where in a vertical refresh we are).

Hmm... Is there someone more knowledgeable on EGA/VGA registers here, who
could confirm or deny this? :)

-- 
-=- Rjs -=- rjs@spider.compart.fi - http://isil.lloke.dna.fi/rjs/