drm/radeon/kms: fix R3XX/R4XX memory controller initialization
diff mbox

Message ID 1266503029-4116-1-git-send-email-jglisse@redhat.com
State New, archived
Headers show

Commit Message

Jerome Glisse Feb. 18, 2010, 2:23 p.m. UTC
None

Patch
diff mbox

diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 7f8dd10..765c4e5 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -505,7 +505,8 @@  int r300_gpu_reset(struct radeon_device *rdev)
  */
 void r300_mc_init(struct radeon_device *rdev)
 {
-	uint32_t tmp;
+	u64 base;
+	u32 tmp;
 
 	/* DDR for all card after R300 & IGP */
 	rdev->mc.vram_is_ddr = true;
@@ -518,6 +519,10 @@  void r300_mc_init(struct radeon_device *rdev)
 	default:  rdev->mc.vram_width = 128; break;
 	}
 	r100_vram_init_sizes(rdev);
+	base = rdev->mc.aper_base;
+	if (rdev->flags & RADEON_IS_IGP)
+		base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16;
+	radeon_vram_location(rdev, &rdev->mc, base);
 	if (!(rdev->flags & RADEON_IS_AGP))
 		radeon_gtt_location(rdev, &rdev->mc);
 }