diff options
author | Michel Daenzer <michel@daenzer.net> | 2001-01-29 22:10:11 +0000 |
---|---|---|
committer | Michel Daenzer <michel@daenzer.net> | 2001-01-29 22:10:11 +0000 |
commit | 70668ec9d2fb2630641b6c63b7a92702b341dfc8 (patch) | |
tree | 91a0063f60d7ee0d1c076a58e13c8c56c2ddb379 | |
parent | d4f794a30eb55eb2933cfd8dc2fed6040febc750 (diff) |
change ring head macros and fix remaining head access
-rw-r--r-- | linux/r128_cce.c | 12 | ||||
-rw-r--r-- | linux/r128_drv.h | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/linux/r128_cce.c b/linux/r128_cce.c index 101e4ef7..d999d232 100644 --- a/linux/r128_cce.c +++ b/linux/r128_cce.c @@ -130,7 +130,7 @@ static void r128_status( drm_r128_private_t *dev_priv ) printk( "PM4_BUFFER_CNTL = 0x%08x\n", (unsigned int)R128_READ( R128_PM4_BUFFER_CNTL ) ); printk( "*ring.head = 0x%08x\n", - (unsigned int) GET_RING_HEAD( dev_priv ) ); + (unsigned int) GET_RING_HEAD( &dev_priv->ring ) ); } #endif @@ -231,7 +231,7 @@ int r128_do_cce_idle( drm_r128_private_t *dev_priv ) int i; for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) { - if ( GET_RING_HEAD( dev_priv ) == dev_priv->ring.tail ) { + if ( GET_RING_HEAD( &dev_priv->ring ) == dev_priv->ring.tail ) { u32 pm4stat = R128_READ( R128_PM4_STAT ); if ( ( (pm4stat & R128_PM4_FIFOCNT_MASK) >= dev_priv->cce_fifo_size ) && @@ -273,7 +273,7 @@ static void r128_do_cce_reset( drm_r128_private_t *dev_priv ) R128_WRITE( R128_PM4_BUFFER_DL_WPTR, 0 ); R128_WRITE( R128_PM4_BUFFER_DL_RPTR, 0 ); - SET_RING_HEAD( dev_priv, 0 ); + SET_RING_HEAD( &dev_priv->ring, 0 ); dev_priv->ring.tail = 0; } @@ -352,7 +352,7 @@ static void r128_cce_init_ring_buffer( drm_device_t *dev ) R128_WRITE( R128_PM4_BUFFER_DL_RPTR, 0 ); /* DL_RPTR_ADDR is a physical address in AGP space. */ - SET_RING_HEAD( dev_priv, 0 ); + SET_RING_HEAD( &dev_priv->ring, 0 ); if ( !dev_priv->is_pci ) { R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR, dev_priv->ring_rptr->offset ); @@ -955,7 +955,7 @@ 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; + ring->space = GET_RING_HEAD( ring ) - ring->tail; if ( ring->space <= 0 ) ring->space += ring->size; @@ -974,7 +974,7 @@ 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; + ring->space = GET_RING_HEAD( ring ) - ring->tail; #if R128_PERFORMANCE_BOXES if ( ring->space == 0 ) atomic_inc( &dev_priv->idle_count ); diff --git a/linux/r128_drv.h b/linux/r128_drv.h index 44e1e306..48d91a1f 100644 --- a/linux/r128_drv.h +++ b/linux/r128_drv.h @@ -463,7 +463,7 @@ do { \ drm_r128_ring_buffer_t *ring = &dev_priv->ring; int i; \ if ( ring->space < ring->high_mark ) { \ for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) { \ - ring->space = *ring->head - ring->tail; \ + ring->space = GET_RING_HEAD( ring ) - ring->tail; \ if ( ring->space <= 0 ) \ ring->space += ring->size; \ if ( ring->space >= ring->high_mark ) \ @@ -538,7 +538,7 @@ do { \ write &= tail_mask; \ } while (0) -#define GET_RING_HEAD( dev_priv ) le32_to_cpu( *dev_priv->ring.head ) -#define SET_RING_HEAD( dev_priv, val ) *dev_priv->ring.head = cpu_to_le32( val ) +#define GET_RING_HEAD( ring ) le32_to_cpu( *(ring)->head ) +#define SET_RING_HEAD( ring, val ) *(ring)->head = cpu_to_le32( val ) #endif /* __R128_DRV_H__ */ |