summaryrefslogtreecommitdiff
path: root/linux/radeon_cp.c
diff options
context:
space:
mode:
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;