aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rs400.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2009-07-10 14:44:47 -0400
committerDave Airlie <airlied@redhat.com>2009-07-15 03:13:19 -0400
commit2a0f8918fc34713ecaeb900ffb9afa61df4cb08e (patch)
tree672d6e6788cd0f4100b912aa7029fa38c513a23c /drivers/gpu/drm/radeon/rs400.c
parentad49f501867cba87e1e45e5ebae0b12435d68bf1 (diff)
drm/radeon/kms: fix VRAM sizing like DDX does it.
Doing this like the DDX seems like the most sure fire way to avoid having to reinvent it slowly and painfully. At the moment we keep getting things wrong with aper vs vram, so we know the DDX does it right. booted on PCI r100, PCIE rv370, IGP rs400. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/rs400.c')
-rw-r--r--drivers/gpu/drm/radeon/rs400.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index a18d053065c..daf24e85cba 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -292,24 +292,12 @@ void rs400_gpu_init(struct radeon_device *rdev)
292 */ 292 */
293void rs400_vram_info(struct radeon_device *rdev) 293void rs400_vram_info(struct radeon_device *rdev)
294{ 294{
295 uint32_t tom;
296
297 rs400_gart_adjust_size(rdev); 295 rs400_gart_adjust_size(rdev);
298 /* DDR for all card after R300 & IGP */ 296 /* DDR for all card after R300 & IGP */
299 rdev->mc.vram_is_ddr = true; 297 rdev->mc.vram_is_ddr = true;
300 rdev->mc.vram_width = 128; 298 rdev->mc.vram_width = 128;
301 299
302 /* read NB_TOM to get the amount of ram stolen for the GPU */ 300 r100_vram_init_sizes(rdev);
303 tom = RREG32(RADEON_NB_TOM);
304 rdev->mc.vram_size = (((tom >> 16) - (tom & 0xffff) + 1) << 16);
305 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size);
306
307 /* RS480 IGPs don't seem to translate to main RAM, they
308 * just reserve and scan out of it. So setting VRAM location
309 * to say 0, will actually trash the OS. */
310 rdev->mc.vram_location = (tom & 0xffff) << 16;
311 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
312 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
313} 301}
314 302
315 303