> On Fri, Nov 01, 2002 at 10:41:33PM +0100, [EMAIL PROTECTED] wrote: > > > > If one knew the time until vblank, one could simply wait that time, > > and then do a xsync. > > > > It could really be that simple. > > You can't sleep with that level of precision.
That depends entirely on which OS and which kernel. > Even if you could, there will be latency between when your timer expires > and when you wake up. Sure. Then time that, and compensate. > You also don't know how much latency there was from the time you asked > until the time you went to sleep, so you've added two unknown latencies > together. Finding the time through a simple function call takes microseconds, so it is not a problem. If network overhead is a problem, the function should be local but synchronized with the screen. > If you assume the worst-case latency of even a low-latency patched > system is ~1.5ms, then adding two together gives you ~3ms. The vertical > blanking period itself is in this range of time. You assume wrongly that things must happen in the vertical blanking period. Since the screen is traced from the top on monitors, all an operation has to do to get a flickerfree update, is to not collide with the screen tracing. F.ex. it could draw the upper part of the screen when the lower is traced, and vice versa. There are lots of other solutions to this same problem. > You also don't know how accurate the timer counting to the next vblank > is. Perhaps it's off. That argument can be applied to ANY function, so it is irrelevant. Besides, accuracy of timers can be measured. > The only reasonable interface here is to grab a kernel object directly, > and somehow block until the vblank (probably best all around), or > schedule a signal to be delivered after the vblank interrupt goes off. > That way, you trigger directly off the event, and you only incur one > unavoidable period of latency. So, you want all operating systems to change their "kernels" to support one particular X11 function. That is a very unlikely prospect. And why not instead use a functionality that nearly all operating systems have, namely timer trigged interrupts and signals? Just synchronize the vblank timing with a timer from the operating system, and you get just what you want: a "kernel" delivered interrupt or signal. [EMAIL PROTECTED] _______________________________________________ Xpert mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/xpert
