aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rs600.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-02-17 16:54:29 -0500
committerDave Airlie <airlied@redhat.com>2010-02-17 23:49:35 -0500
commitd594e46ace22afa1621254f6f669e65430048153 (patch)
treebefd5b54ce1b8284acc4ee450d085a7d2c7b01fd /drivers/gpu/drm/radeon/rs600.c
parent44ca7478d46aaad488d916f7262253e000ee60f9 (diff)
drm/radeon/kms: simplify memory controller setup V2
Get rid of _location and use _start/_end also simplify the computation of vram_start|end & gtt_start|end. For R1XX-R2XX we place VRAM at the same address of PCI aperture, those GPU shouldn't have much memory and seems to behave better when setup that way. For R3XX and newer we place VRAM at 0. For R6XX-R7XX AGP we place VRAM before or after AGP aperture this might limit to limit the VRAM size but it's very unlikely. For IGP we don't change the VRAM placement. Tested on (compiz,quake3,suspend/resume): PCI/PCIE:RV280,R420,RV515,RV570,RV610,RV710 AGP:RV100,RV280,R420,RV350,RV620(RPB*),RV730 IGP:RS480(RPB*),RS690,RS780(RPB*),RS880 RPB: resume previously broken V2 correct commit message to reflect more accurately the bug and move VRAM placement to 0 for most of the GPU to avoid limiting VRAM. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/rs600.c')
-rw-r--r--drivers/gpu/drm/radeon/rs600.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 28c8690c7a35..d5aeb2a31d59 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -45,23 +45,6 @@
45void rs600_gpu_init(struct radeon_device *rdev); 45void rs600_gpu_init(struct radeon_device *rdev);
46int rs600_mc_wait_for_idle(struct radeon_device *rdev); 46int rs600_mc_wait_for_idle(struct radeon_device *rdev);
47 47
48int rs600_mc_init(struct radeon_device *rdev)
49{
50 /* read back the MC value from the hw */
51 int r;
52 u32 tmp;
53
54 /* Setup GPU memory space */
55 tmp = RREG32_MC(R_000004_MC_FB_LOCATION);
56 rdev->mc.vram_location = G_000004_MC_FB_START(tmp) << 16;
57 rdev->mc.gtt_location = 0xffffffffUL;
58 r = radeon_mc_setup(rdev);
59 rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
60 if (r)
61 return r;
62 return 0;
63}
64
65/* hpd for digital panel detect/disconnect */ 48/* hpd for digital panel detect/disconnect */
66bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd) 49bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd)
67{ 50{
@@ -475,22 +458,21 @@ void rs600_gpu_init(struct radeon_device *rdev)
475 dev_warn(rdev->dev, "Wait MC idle timeout before updating MC.\n"); 458 dev_warn(rdev->dev, "Wait MC idle timeout before updating MC.\n");
476} 459}
477 460
478void rs600_vram_info(struct radeon_device *rdev) 461void rs600_mc_init(struct radeon_device *rdev)
479{ 462{
463 u64 base;
464
480 rdev->mc.vram_is_ddr = true; 465 rdev->mc.vram_is_ddr = true;
481 rdev->mc.vram_width = 128; 466 rdev->mc.vram_width = 128;
482
483 rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE); 467 rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
484 rdev->mc.mc_vram_size = rdev->mc.real_vram_size; 468 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
485
486 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 469 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
487 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 470 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
488 471 rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
489 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) 472 base = RREG32_MC(R_000004_MC_FB_LOCATION);
490 rdev->mc.mc_vram_size = rdev->mc.aper_size; 473 base = G_000004_MC_FB_START(base) << 16;
491 474 radeon_vram_location(rdev, &rdev->mc, base);
492 if (rdev->mc.real_vram_size > rdev->mc.aper_size) 475 radeon_gtt_location(rdev, &rdev->mc);
493 rdev->mc.real_vram_size = rdev->mc.aper_size;
494} 476}
495 477
496void rs600_bandwidth_update(struct radeon_device *rdev) 478void rs600_bandwidth_update(struct radeon_device *rdev)
@@ -666,12 +648,8 @@ int rs600_init(struct radeon_device *rdev)
666 radeon_get_clock_info(rdev->ddev); 648 radeon_get_clock_info(rdev->ddev);
667 /* Initialize power management */ 649 /* Initialize power management */
668 radeon_pm_init(rdev); 650 radeon_pm_init(rdev);
669 /* Get vram informations */ 651 /* initialize memory controller */
670 rs600_vram_info(rdev); 652 rs600_mc_init(rdev);
671 /* Initialize memory controller (also test AGP) */
672 r = rs600_mc_init(rdev);
673 if (r)
674 return r;
675 rs600_debugfs(rdev); 653 rs600_debugfs(rdev);
676 /* Fence driver */ 654 /* Fence driver */
677 r = radeon_fence_driver_init(rdev); 655 r = radeon_fence_driver_init(rdev);