Skip to contentSkip to conversation

: drm: radeon: Fix calculation of RB_RPTR_ADDR in non-AGP case.

PATCH In review David Miller 1 participant 1 message Feb 12, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/5 : drm: radeon: Fix calculation of RB_RPTR_ADDR in non-AGP case.

The address needs to be a GART relative address, rather than a PCI DMA address.

---
 drivers/gpu/drm/radeon/radeon_cp.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/radeon/radeon_cp.c +4 -11
index 9053755..e235778 100644
@@ -655,17 +655,10 @@ static void radeon_cp_init_ring_buffer(struct drm_device * dev,
 	} else
 #endif
 	{
-		struct drm_sg_mem *entry = dev->sg;
-		unsigned long tmp_ofs, page_ofs;
-
-		tmp_ofs = dev_priv->ring_rptr->offset -
-				(unsigned long)dev->sg->virtual;
-		page_ofs = tmp_ofs >> PAGE_SHIFT;
-
-		RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs]);
-		DRM_DEBUG("ring rptr: offset=0x%08lx handle=0x%08lx\n",
-			  (unsigned long)entry->busaddr[page_ofs],
-			  entry->handle + tmp_ofs);
+		RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR,
+			     dev_priv->ring_rptr->offset
+			     - ((unsigned long) dev->sg->virtual)
+			     + dev_priv->gart_vm_start);
 	}
 
 	/* Set ring buffer size */
Signature · 1 line
1.6.1.2.350.g88cc