aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/radeon_cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/radeon_cp.c')
-rw-r--r--drivers/char/drm/radeon_cp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 6d9080a3ca7e..12ef13ff04ca 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1133,10 +1133,10 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev,
1133 ring_start = (dev_priv->cp_ring->offset 1133 ring_start = (dev_priv->cp_ring->offset
1134 - dev->agp->base 1134 - dev->agp->base
1135 + dev_priv->gart_vm_start); 1135 + dev_priv->gart_vm_start);
1136 } else 1136 } else
1137#endif 1137#endif
1138 ring_start = (dev_priv->cp_ring->offset 1138 ring_start = (dev_priv->cp_ring->offset
1139 - dev->sg->handle 1139 - (unsigned long)dev->sg->virtual
1140 + dev_priv->gart_vm_start); 1140 + dev_priv->gart_vm_start);
1141 1141
1142 RADEON_WRITE( RADEON_CP_RB_BASE, ring_start ); 1142 RADEON_WRITE( RADEON_CP_RB_BASE, ring_start );
@@ -1164,7 +1164,8 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev,
1164 drm_sg_mem_t *entry = dev->sg; 1164 drm_sg_mem_t *entry = dev->sg;
1165 unsigned long tmp_ofs, page_ofs; 1165 unsigned long tmp_ofs, page_ofs;
1166 1166
1167 tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; 1167 tmp_ofs = dev_priv->ring_rptr->offset -
1168 (unsigned long)dev->sg->virtual;
1168 page_ofs = tmp_ofs >> PAGE_SHIFT; 1169 page_ofs = tmp_ofs >> PAGE_SHIFT;
1169 1170
1170 RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, 1171 RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR,
@@ -1491,8 +1492,8 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
1491 else 1492 else
1492#endif 1493#endif
1493 dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset 1494 dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset
1494 - dev->sg->handle 1495 - (unsigned long)dev->sg->virtual
1495 + dev_priv->gart_vm_start); 1496 + dev_priv->gart_vm_start);
1496 1497
1497 DRM_DEBUG( "dev_priv->gart_size %d\n", 1498 DRM_DEBUG( "dev_priv->gart_size %d\n",
1498 dev_priv->gart_size ); 1499 dev_priv->gart_size );