diff options
author | David Miller <davem@davemloft.net> | 2009-02-12 05:15:44 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-03-13 00:24:02 -0400 |
commit | e8a894372b4ea05dc266ba7d7a7634315b6230e8 (patch) | |
tree | b6aa5fc6fec46ca6059989fb718b8049b35a22a7 /drivers/gpu/drm | |
parent | b266503072f824a82d585a6d41ebd591a2d7daa4 (diff) |
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.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cp.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index 8a8a82a2c170..4a56e7d626a6 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu/drm/radeon/radeon_cp.c | |||
@@ -657,17 +657,10 @@ static void radeon_cp_init_ring_buffer(struct drm_device * dev, | |||
657 | } else | 657 | } else |
658 | #endif | 658 | #endif |
659 | { | 659 | { |
660 | struct drm_sg_mem *entry = dev->sg; | 660 | RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR, |
661 | unsigned long tmp_ofs, page_ofs; | 661 | dev_priv->ring_rptr->offset |
662 | 662 | - ((unsigned long) dev->sg->virtual) | |
663 | tmp_ofs = dev_priv->ring_rptr->offset - | 663 | + dev_priv->gart_vm_start); |
664 | (unsigned long)dev->sg->virtual; | ||
665 | page_ofs = tmp_ofs >> PAGE_SHIFT; | ||
666 | |||
667 | RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs]); | ||
668 | DRM_DEBUG("ring rptr: offset=0x%08lx handle=0x%08lx\n", | ||
669 | (unsigned long)entry->busaddr[page_ofs], | ||
670 | entry->handle + tmp_ofs); | ||
671 | } | 664 | } |
672 | 665 | ||
673 | /* Set ring buffer size */ | 666 | /* Set ring buffer size */ |