diff options
author | Dave Airlie | 2010-02-05 13:57:03 +1000 |
---|---|---|
committer | Dave Airlie | 2010-02-05 14:00:03 +1000 |
commit | 5ff55717674470b96562f931f778c878080755b7 (patch) | |
tree | 645a93c88420709e1072fd9b01d33cdf66472782 /drivers | |
parent | a17538f93c16f0e15e35dc31eedad87e2d9c5c26 (diff) |
drm/radeon/kms: fix r300 vram width calculations
This was incorrect according to the docs and the UMS driver does
it like this.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index e699e6d053dd..43b55a030b4d 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -506,11 +506,14 @@ void r300_vram_info(struct radeon_device *rdev) /* DDR for all card after R300 & IGP */ rdev->mc.vram_is_ddr = true; + tmp = RREG32(RADEON_MEM_CNTL); - if (tmp & R300_MEM_NUM_CHANNELS_MASK) { - rdev->mc.vram_width = 128; - } else { - rdev->mc.vram_width = 64; + tmp &= R300_MEM_NUM_CHANNELS_MASK; + switch (tmp) { + case 0: rdev->mc.vram_width = 64; break; + case 1: rdev->mc.vram_width = 128; break; + case 2: rdev->mc.vram_width = 256; break; + default: rdev->mc.vram_width = 128; break; } r100_vram_init_sizes(rdev); |