summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-02-19 18:50:49 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-02-19 18:54:14 -0500
commitcadae2a8d9979b2d61eae7d1f7a9ab8f5eb28e83 (patch)
tree183f25c8774305c5d56ed7c21c1d4f6004fea554 /src
parent42492c70c481c88911337eefb97ba9d030adf7b6 (diff)
Fix MC setup on systems with more than 512 MB of VRAM
many thanks to app4des on IRC for helping me sort this out.
Diffstat (limited to 'src')
-rw-r--r--src/radeon_driver.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 74245777..8591b3c9 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1261,8 +1261,8 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
- uint32_t mem_size;
- uint32_t aper_size;
+ uint64_t mem_size;
+ uint64_t aper_size;
radeon_read_mc_fb_agp_location(pScrn, LOC_FB | LOC_AGP, &info->mc_fb_location,
&info->mc_agp_location, &info->mc_agp_location_hi);
@@ -1333,12 +1333,14 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
aper0_base &= ~(mem_size - 1);
if (info->ChipFamily >= CHIP_FAMILY_R600) {
- info->mc_fb_location = (aper0_base >> 24) |
- (((aper0_base + mem_size - 1) & 0xff000000U) >> 8);
+ uint64_t mc_fb = ((aper0_base >> 24) & 0xffff) |
+ (((aper0_base + mem_size - 1) >> 8) & 0xffff0000);
+ info->mc_fb_location = mc_fb & 0xffffffff;
ErrorF("mc fb loc is %08x\n", (unsigned int)info->mc_fb_location);
} else {
- info->mc_fb_location = (aper0_base >> 16) |
+ uint64_t mc_fb = ((aper0_base >> 16) & 0xffff) |
((aper0_base + mem_size - 1) & 0xffff0000U);
+ info->mc_fb_location = mc_fb & 0xffffffff;
}
}
}