On Tue, 2003-09-23 at 07:55, Mark Vojkovich wrote:
> On Tue, 23 Sep 2003, Nathan Hand wrote:
>
> > On Tue, 2003-09-23 at 05:58, Mark Vojkovich wrote:
> > > Can we export to the drivers some function that yields the CPU?
> > > Currently alot of drivers burn the CPU waiting for fifos, etc...
> > > usleep(0) is not good for this because it's jiffy based and usually
> > > never returns in less than 10 msec which has the effect of making
> > > interactivity worse instead of better. I'm not sure which platforms
> > > don't export sched_yield() and which will need alternative
> > > implementations.
> >
> > FIFO busy loops are very quick. You'll harm overall graphic performance
> > by yielding.
>
> Your experience is out of date. If I've just filled a Megabyte
> DMA fifo and I'm waiting to cram another Megabyte into it, how
> quick is my FIFO busy loop then? I've had great success with
> sched_yield().
>
There's no disputing the first comment :-/
Wouldn't it be easier to dynamically adjust the size of the FIFO? So
instead of
slice 1) send 1 megabyte
...
slice 2) fifo not drained, yield
...
slice 3) fifo not drained, yield
...
slice 4) fifo drained, send 1 megabyte
...
<repeat forever, many wasted slices>
Why not
slice 1) send 1 megabyte
...
slice 2) fifo not drained, reduce fifo to 512kB, wait
...
slice 3) fifo not drained, reduce fifo to 256kB, wait
...
slice 4) fifo drained, send 256kB
...
slice 5) fifo drained, send 256kB
A bigger FIFO reduces the risk of the FIFO emptying before you're ready
but if your slices are arriving faster than the GPU can drain the FIFO,
does it really matter?
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel