Re: __set_origin in vga.c and screen flickering

Jon Tombs (jon@gte.esi.us.es)
Sat, 25 May 1996 01:23:04 +0200 (MET DST)


Paul Gortmaker said:
> > If i understand it right, Linux does console scrolling by setting the
> > "origin" of the visible screen in the VGA memory. We avoid to copy the
> > whole screen with this solution. But very rarely the screen "flickers"
> > as if it got out of sync. If i remember right, the problem is the following
> > code in vga.c:
> >
> > outb_p(12, video_port_reg);
> > outb_p(offset >> 8, video_port_val);
> > outb_p(13, video_port_reg);
> > outb_p(offset, video_port_val);
> >
> True, it does look a bit clunky. You should be able to reduce the window
> of opportunity by simply changing the outb_p to simple outb calls.
> Assuming you don't have an old 8bit 256kB VGA card from 1987, it probably
> can survive without the dummy i/o cycle inserted inbetween anyway.
> Hrrm, I'll have to try this...

You can probably also change the outb()s to an outw() and write both the reg
and value at the same time (the video_port_val port is 1 more than the
video_port_reg). Actually I'd be surpised if outw() without the _p didn't
work, the Xservers all use outw() to do the hardware panning when with a
virtual display bigger than the display.

Jon <jon@gte.esi.us.es, http://www.esi.us.es/~jon>