aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rv770.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/rv770.c')
-rw-r--r--drivers/gpu/drm/radeon/rv770.c41
1 files changed, 5 insertions, 36 deletions
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 6f1f4abbe88c..323fa6be5082 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -820,45 +820,12 @@ int rv770_mc_init(struct radeon_device *rdev)
820 /* Setup GPU memory space */ 820 /* Setup GPU memory space */
821 rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); 821 rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE);
822 rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); 822 rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE);
823 823 /* FIXME remove this once we support unmappable VRAM */
824 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) 824 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) {
825 rdev->mc.mc_vram_size = rdev->mc.aper_size; 825 rdev->mc.mc_vram_size = rdev->mc.aper_size;
826
827 if (rdev->mc.real_vram_size > rdev->mc.aper_size)
828 rdev->mc.real_vram_size = rdev->mc.aper_size; 826 rdev->mc.real_vram_size = rdev->mc.aper_size;
829
830 if (rdev->flags & RADEON_IS_AGP) {
831 /* gtt_size is setup by radeon_agp_init */
832 rdev->mc.gtt_location = rdev->mc.agp_base;
833 tmp = 0xFFFFFFFFUL - rdev->mc.agp_base - rdev->mc.gtt_size;
834 /* Try to put vram before or after AGP because we
835 * we want SYSTEM_APERTURE to cover both VRAM and
836 * AGP so that GPU can catch out of VRAM/AGP access
837 */
838 if (rdev->mc.gtt_location > rdev->mc.mc_vram_size) {
839 /* Enought place before */
840 rdev->mc.vram_location = rdev->mc.gtt_location -
841 rdev->mc.mc_vram_size;
842 } else if (tmp > rdev->mc.mc_vram_size) {
843 /* Enought place after */
844 rdev->mc.vram_location = rdev->mc.gtt_location +
845 rdev->mc.gtt_size;
846 } else {
847 /* Try to setup VRAM then AGP might not
848 * not work on some card
849 */
850 rdev->mc.vram_location = 0x00000000UL;
851 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
852 }
853 } else {
854 rdev->mc.vram_location = 0x00000000UL;
855 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
856 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
857 } 827 }
858 rdev->mc.vram_start = rdev->mc.vram_location; 828 r600_vram_gtt_location(rdev, &rdev->mc);
859 rdev->mc.vram_end = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
860 rdev->mc.gtt_start = rdev->mc.gtt_location;
861 rdev->mc.gtt_end = rdev->mc.gtt_location + rdev->mc.gtt_size - 1;
862 /* FIXME: we should enforce default clock in case GPU is not in 829 /* FIXME: we should enforce default clock in case GPU is not in
863 * default setup 830 * default setup
864 */ 831 */
@@ -867,6 +834,7 @@ int rv770_mc_init(struct radeon_device *rdev)
867 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a); 834 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a);
868 return 0; 835 return 0;
869} 836}
837
870int rv770_gpu_reset(struct radeon_device *rdev) 838int rv770_gpu_reset(struct radeon_device *rdev)
871{ 839{
872 /* FIXME: implement any rv770 specific bits */ 840 /* FIXME: implement any rv770 specific bits */
@@ -1042,6 +1010,7 @@ int rv770_init(struct radeon_device *rdev)
1042 r = radeon_fence_driver_init(rdev); 1010 r = radeon_fence_driver_init(rdev);
1043 if (r) 1011 if (r)
1044 return r; 1012 return r;
1013 /* initialize AGP */
1045 if (rdev->flags & RADEON_IS_AGP) { 1014 if (rdev->flags & RADEON_IS_AGP) {
1046 r = radeon_agp_init(rdev); 1015 r = radeon_agp_init(rdev);
1047 if (r) 1016 if (r)