aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/radeon_cp.c
diff options
context:
space:
mode:
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>2005-10-26 06:05:25 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-26 13:46:19 -0400
commitb0917bd912d3708c50e1df1b5e1648d0547108a3 (patch)
tree3e96b8ca817eb6be2a2751167bb879d0b3350b80 /drivers/char/drm/radeon_cp.c
parent4bcde03d41d2264edb4ea3c47cb27da1e2609e48 (diff)
[PATCH] fix radeon_cp_init_ring_buffer()
I've seen similar failure on alpha. Obviously, someone forgot to convert sg->handle stuff for PCI gart case. Signed-off-by: Dave Airlie <airlied@linux.ie> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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 );