On Tue, 23 Sep 2003, Nathan Hand wrote:
> 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
>
[...]
>
> 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?
It's all the same. If data is getting pushed to the driver faster
than the HW can consume it, the driver has to burn the CPU or yield.
People often ask me "If NVIDIA's drivers are using DMA for XvShmPutImage
then why is the X-server eating 100% of the CPU when running their
benchmark?" People seem to think that DMA is some infinite bandwidth
hole that you can dump data into. It's not true. It allows you to
have to poll less often because of the large fifo, but when it fills
up, you're in the same position you're in with MMIO - constantly polling
for new space to get freed up. Yielding really helps here. It's
usually the case that the graphics engine is still chewing on the data
when you get the CPU back, but now there's a chance that you've got
some space freed up. So...
small fifo == yielding not useful
big fifo == yielding useful
Mark.
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel