Commit b0917bd9 authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Linus Torvalds

[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: default avatarDave Airlie <airlied@linux.ie>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4bcde03d
...@@ -1136,7 +1136,7 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev, ...@@ -1136,7 +1136,7 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev,
} else } else
#endif #endif
ring_start = (dev_priv->cp_ring->offset ring_start = (dev_priv->cp_ring->offset
- dev->sg->handle - (unsigned long)dev->sg->virtual
+ dev_priv->gart_vm_start); + dev_priv->gart_vm_start);
RADEON_WRITE( RADEON_CP_RB_BASE, ring_start ); RADEON_WRITE( RADEON_CP_RB_BASE, ring_start );
...@@ -1164,7 +1164,8 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev, ...@@ -1164,7 +1164,8 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev,
drm_sg_mem_t *entry = dev->sg; drm_sg_mem_t *entry = dev->sg;
unsigned long tmp_ofs, page_ofs; unsigned long tmp_ofs, page_ofs;
tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; tmp_ofs = dev_priv->ring_rptr->offset -
(unsigned long)dev->sg->virtual;
page_ofs = tmp_ofs >> PAGE_SHIFT; page_ofs = tmp_ofs >> PAGE_SHIFT;
RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR,
...@@ -1491,7 +1492,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) ...@@ -1491,7 +1492,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
else else
#endif #endif
dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset
- dev->sg->handle - (unsigned long)dev->sg->virtual
+ dev_priv->gart_vm_start); + dev_priv->gart_vm_start);
DRM_DEBUG( "dev_priv->gart_size %d\n", DRM_DEBUG( "dev_priv->gart_size %d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment