aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-12-03 16:28:02 -0500
committerDave Airlie <airlied@redhat.com>2009-12-03 19:32:35 -0500
commit0088dbdb809e8799cb8f26da5ac64b15201fa99d (patch)
tree3d38533b297da8d47f663ffd79d7dd1cc3da31a5 /drivers/gpu/drm
parent722f29434e72188b2d20f9b41f4b5952073ed568 (diff)
drm/radeon/kms: rs6xx/rs740: clamp vram to aperture size
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/radeon/rs600.c9
-rw-r--r--drivers/gpu/drm/radeon/rs690.c9
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 00bc71fe98d1..c4bdfaf9b54c 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -306,9 +306,7 @@ int rs600_mc_wait_for_idle(struct radeon_device *rdev)
306 306
307void rs600_gpu_init(struct radeon_device *rdev) 307void rs600_gpu_init(struct radeon_device *rdev)
308{ 308{
309 /* FIXME: HDP same place on rs600 ? */
310 r100_hdp_reset(rdev); 309 r100_hdp_reset(rdev);
311 /* FIXME: is this correct ? */
312 r420_pipes_init(rdev); 310 r420_pipes_init(rdev);
313 /* Wait for mc idle */ 311 /* Wait for mc idle */
314 if (rs600_mc_wait_for_idle(rdev)) 312 if (rs600_mc_wait_for_idle(rdev))
@@ -317,7 +315,6 @@ void rs600_gpu_init(struct radeon_device *rdev)
317 315
318void rs600_vram_info(struct radeon_device *rdev) 316void rs600_vram_info(struct radeon_device *rdev)
319{ 317{
320 /* FIXME: to do or is these values sane ? */
321 rdev->mc.vram_is_ddr = true; 318 rdev->mc.vram_is_ddr = true;
322 rdev->mc.vram_width = 128; 319 rdev->mc.vram_width = 128;
323 320
@@ -326,6 +323,12 @@ void rs600_vram_info(struct radeon_device *rdev)
326 323
327 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 324 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
328 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 325 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
326
327 if (rdev->mc.mc_vram_size > rdev->mc.aper_size)
328 rdev->mc.mc_vram_size = rdev->mc.aper_size;
329
330 if (rdev->mc.real_vram_size > rdev->mc.aper_size)
331 rdev->mc.real_vram_size = rdev->mc.aper_size;
329} 332}
330 333
331void rs600_bandwidth_update(struct radeon_device *rdev) 334void rs600_bandwidth_update(struct radeon_device *rdev)
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 81b8efcac4e8..30913c3b5ba1 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -134,7 +134,7 @@ void rs690_vram_info(struct radeon_device *rdev)
134 fixed20_12 a; 134 fixed20_12 a;
135 135
136 rs400_gart_adjust_size(rdev); 136 rs400_gart_adjust_size(rdev);
137 /* DDR for all card after R300 & IGP */ 137
138 rdev->mc.vram_is_ddr = true; 138 rdev->mc.vram_is_ddr = true;
139 rdev->mc.vram_width = 128; 139 rdev->mc.vram_width = 128;
140 140
@@ -143,6 +143,13 @@ void rs690_vram_info(struct radeon_device *rdev)
143 143
144 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 144 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
145 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 145 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
146
147 if (rdev->mc.mc_vram_size > rdev->mc.aper_size)
148 rdev->mc.mc_vram_size = rdev->mc.aper_size;
149
150 if (rdev->mc.real_vram_size > rdev->mc.aper_size)
151 rdev->mc.real_vram_size = rdev->mc.aper_size;
152
146 rs690_pm_info(rdev); 153 rs690_pm_info(rdev);
147 /* FIXME: we should enforce default clock in case GPU is not in 154 /* FIXME: we should enforce default clock in case GPU is not in
148 * default setup 155 * default setup