[PATCH] drm/radeon/kms: fix vram base calculation on rs780/rs880
Alex Deucher
alexdeucher at gmail.com
Fri Dec 3 11:37:22 PST 2010
Avoid overflowing a 32 bit value.
Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
Cc: stable at kernel.org
---
drivers/gpu/drm/radeon/r600.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 53bfe3a..c6a37e0 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1198,8 +1198,10 @@ static void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc
mc->vram_end, mc->real_vram_size >> 20);
} else {
u64 base = 0;
- if (rdev->flags & RADEON_IS_IGP)
- base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24;
+ if (rdev->flags & RADEON_IS_IGP) {
+ base = RREG32(MC_VM_FB_LOCATION) & 0xFFFF;
+ base <<= 24;
+ }
radeon_vram_location(rdev, &rdev->mc, base);
rdev->mc.gtt_base_align = 0;
radeon_gtt_location(rdev, mc);
--
1.7.1.1
More information about the dri-devel
mailing list