summaryrefslogtreecommitdiff
path: root/linux/r128_cce.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/r128_cce.c
parent8c511c60ec1ecbe3f0832a8e5a07bc43239eae5f (diff)
Fix ring space calculations, tests. Based on patch by Bruce Stockwell.
Diffstat (limited to 'linux/r128_cce.c')
-rw-r--r--linux/r128_cce.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/linux/r128_cce.c b/linux/r128_cce.c
index d1790497..5c67bec9 100644
--- a/linux/r128_cce.c
+++ b/linux/r128_cce.c
@@ -839,13 +839,9 @@ int r128_wait_ring( drm_r128_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;
-
+ r128_update_ring_snapshot( ring );
if ( ring->space >= n )
return 0;
-
udelay( 1 );
}
@@ -854,19 +850,6 @@ int r128_wait_ring( drm_r128_private_t *dev_priv, int n )
return -EBUSY;
}
-void r128_update_ring_snapshot( drm_r128_private_t *dev_priv )
-{
- drm_r128_ring_buffer_t *ring = &dev_priv->ring;
-
- ring->space = *ring->head - ring->tail;
-#if R128_PERFORMANCE_BOXES
- if ( ring->space == 0 )
- atomic_inc( &dev_priv->idle_count );
-#endif
- if ( ring->space <= 0 )
- ring->space += ring->size;
-}
-
static int r128_cce_get_buffers( drm_device_t *dev, drm_dma_t *d )
{
int i;