Skip to content

Commit

Permalink
drm/radeon/kms: fix r300 vram width calculations
Browse files Browse the repository at this point in the history
This was incorrect according to the docs and the UMS driver does
it like this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
airlied committed Feb 5, 2010
1 parent a17538f commit 5ff5571
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/gpu/drm/radeon/r300.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5ff5571

Please sign in to comment.