Re: [AD] Oddity in src/linux/fbcon.c |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> There's a lot of history about FBIOGET_VBLANK. It all started a
> rainy day... I suck writing, so read this instead:
>
> http://www.mail-archive.com/linux-fbdev@xxxxxxxxxx
>
> This happened several years ago, when I was still using some 2.2.x
> kernel and an Matrox G200. Shawn's patch really improved page
> flipping, but it wasn't accepted because a user space program could
> potentially DOS the machine polling inside an infinite loop.
>
> However, now I'm using a G450 and if I check
> .../linux-2.4.20/drivers/video/matrox/matroxfb_base.c, the new
> driver mentions Shawn's ideas as useful, so maybe they implemented
> it. In fact, the archives mention that I was getting 35fps without
> the patch. Now, with an unpatched kernel I get 60 with 800x600 page
> flipping, sometimes going to 59 or 61. This probably means:
>
> - Matrox has cool video hardware, maybe G450 doesn't need vsyncing.
> - The new kernel has a workaround for that polling flaw which works
> without compromising the system.
> - All of the above?
Thanks for this lesson of history :-)
> So I wouldn't worry about that code, it worked in the past, and
> keeps working ok (at least for me :).
Agreed.
> > The reason for this (Shawn was really happy when he remembered!) is
> > that on a lot of graphics hardware the scroll registers don't
> > take effect until the start of the next frame, so when you do a
> > scroll you want to make sure you've waited at least until then.
> > If you have reliable vsyncing, one call to vysnc is enough,
> > but if you don't then the first call waits some time between 0
> > and 1/60th of a second, and since it's not really synced to the
> > retrace, this may or may not include an actual retrace. However,
> > by making a second call, we then wait for a full 1/60th of a second
> > after the first call, and this is sure to include a retrace,
> > assuming the refresh rate is at least 60Hz. Sometimes overall
> > we'll have waited past two retraces, or even more if the refresh
> > rate is much higher than the fake vblank timer frequency, but
> > it's still better than sometimes missing the retrace completely.
Now in the source code.
--
Eric Botcazou