[please cc me, I'm not on the dri list] On Fri, 2004-08-20 at 22:29, Jon Smirl wrote: > The delay is very large because this routine is waiting for the > graphics coprocessor to finish an operation. Some of the operations can > take many ms to complete; for example telling the chip to copy 64MB of > memory somewhere.
That corresponds to my experience. I currently use glxgears while running low latency audio stuff to test whether the problem is there or not. For small window sizes (of glxgears) everything is fine. If I keep making the window bigger there is a point where I start triggering xruns like crazy (7 to 10 msecs or so). > I would think the question should be, how do we wait > on the GPU without killing both audio and video latency. > > The problem here is that most graphics commands are very short in > duration. Some of these commands can be issued a million of times per > second. A few commands are much longer running. I don't believe there > is an easy way to tell how long the commands will run. > > A better solution might be to loop twenty times to pick up the very > short commands. After 20us switch to a loop that allows the kernel to > schedule. You don't want to immediately schedule since that will kill > graphics performance. What would be a good program that measures graphics performance that I could run to test this? I could build a kernel with a patch I have that has conditional reschedules in it (but it is illegal in the sense that reschedules with a lock held) and see how that impacts performance, or not. But I need something to test that will reflect some metric that makes sense to the graphics crowd. -- Fernando > What's the right way to write a loop like this that meets the above > requirements and also satisfies the audio needs? > > > static int radeon_do_wait_for_idle( drm_radeon_private_t *dev_priv ) > { > int i, ret; > > > dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; > > > ret = radeon_do_wait_for_fifo( dev_priv, 64 ); > if ( ret ) return ret; > > > for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) { > if ( !(RADEON_READ( RADEON_RBBM_STATUS ) > & RADEON_RBBM_ACTIVE) ) { > radeon_do_pixcache_flush( dev_priv ); > return 0; > } > DRM_UDELAY( 1 ); > } > > > #if RADEON_FIFO_DEBUG > DRM_ERROR( "failed!\n" ); > radeon_status( dev_priv ); > #endif > return DRM_ERR(EBUSY); > } > > ===== > Jon Smirl > [EMAIL PROTECTED] ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 -- _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel