summaryrefslogtreecommitdiff
path: root/linux/radeon_cp.c
diff options
context:
space:
mode:
authorGareth Hughes <gareth@users.sourceforge.net>2001-03-08 00:21:33 +0000
committerGareth Hughes <gareth@users.sourceforge.net>2001-03-08 00:21:33 +0000
commit134aecdeed19a339a147d7e88fc9b722b9794245 (patch)
tree4b45955b78c17fb559fe7dee4f1e92691edfd044 /linux/radeon_cp.c
parent8c511c60ec1ecbe3f0832a8e5a07bc43239eae5f (diff)
Fix ring space calculations, tests. Based on patch by Bruce Stockwell.
Diffstat (limited to 'linux/radeon_cp.c')
-rw-r--r--linux/radeon_cp.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/linux/radeon_cp.c b/linux/radeon_cp.c
index 3feb4b24..cea8c327 100644
--- a/linux/radeon_cp.c
+++ b/linux/radeon_cp.c
@@ -1166,13 +1166,9 @@ int radeon_wait_ring( drm_radeon_private_t *dev_priv, int n )
int i;
for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
- ring->space = *ring->head - ring->tail;
- if ( ring->space <= 0 )
- ring->space += ring->size;
-
- if ( ring->space >= n )
+ radeon_update_ring_snapshot( ring );
+ if ( ring->space > n )
return 0;
-
udelay( 1 );
}
@@ -1181,17 +1177,6 @@ int radeon_wait_ring( drm_radeon_private_t *dev_priv, int n )
return -EBUSY;
}
-void radeon_update_ring_snapshot( drm_radeon_private_t *dev_priv )
-{
- drm_radeon_ring_buffer_t *ring = &dev_priv->ring;
-
- ring->space = *ring->head - ring->tail;
- if ( ring->space == 0 )
- atomic_inc( &dev_priv->idle_count );
- if ( ring->space <= 0 )
- ring->space += ring->size;
-}
-
static int radeon_cp_get_buffers( drm_device_t *dev, drm_dma_t *d )
{
int i;