summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jrfonseca@users.sourceforge.net>2002-07-14 18:36:40 +0000
committerJose Fonseca <jrfonseca@users.sourceforge.net>2002-07-14 18:36:40 +0000
commit4492b6d5632a0f830723336debb4396689c7cc1e (patch)
tree41b39f44ad0e567da7cfdee6e41e118ad707afc7
parent7d677fdc40ec6350ce18dcdd194365424d645c65 (diff)
Changed mach64_ring_idle to mesure the time for the ring head advances
instead of completion to avoid spurious timeouts.
-rw-r--r--linux/mach64_dma.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/linux/mach64_dma.c b/linux/mach64_dma.c
index 504ce5c5..a84f5f1c 100644
--- a/linux/mach64_dma.c
+++ b/linux/mach64_dma.c
@@ -190,15 +190,26 @@ int mach64_wait_ring( drm_mach64_private_t *dev_priv, int n )
static int mach64_ring_idle( drm_mach64_private_t *dev_priv )
{
drm_mach64_descriptor_ring_t *ring = &dev_priv->ring;
+ u32 head;
int i;
- for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
+ head = ring->head;
+ i = 0;
+ while ( i < dev_priv->usec_timeout ) {
mach64_update_ring_snapshot( dev_priv );
- if ( ring->head == ring->tail ) {
- if (i > 0) {
- DRM_DEBUG( "mach64_ring_idle: %d usecs\n", i );
+ if ( ring->head == ring->tail && !(MACH64_READ(MACH64_GUI_STAT) & MACH64_GUI_ACTIVE) ) {
+ if ( !(MACH64_READ(MACH64_GUI_STAT) & MACH64_GUI_ACTIVE) ) {
+ if (i > 0) {
+ DRM_DEBUG( "mach64_ring_idle: %d usecs\n", i );
+ }
+ return 0;
}
- return 0;
+ }
+ if ( ring->head == head ) {
+ ++i;
+ } else {
+ head = ring->head;
+ i = 0;
}
udelay( 1 );
}