aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r520.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/r520.c')
-rw-r--r--drivers/gpu/drm/radeon/r520.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index 570a244bd88b..ebd6b0f7bdff 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -28,6 +28,7 @@
28#include "drmP.h" 28#include "drmP.h"
29#include "radeon_reg.h" 29#include "radeon_reg.h"
30#include "radeon.h" 30#include "radeon.h"
31#include "radeon_share.h"
31 32
32/* r520,rv530,rv560,rv570,r580 depends on : */ 33/* r520,rv530,rv560,rv570,r580 depends on : */
33void r100_hdp_reset(struct radeon_device *rdev); 34void r100_hdp_reset(struct radeon_device *rdev);
@@ -94,8 +95,8 @@ int r520_mc_init(struct radeon_device *rdev)
94 "programming pipes. Bad things might happen.\n"); 95 "programming pipes. Bad things might happen.\n");
95 } 96 }
96 /* Write VRAM size in case we are limiting it */ 97 /* Write VRAM size in case we are limiting it */
97 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 98 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
98 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 99 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
99 tmp = REG_SET(R520_MC_FB_TOP, tmp >> 16); 100 tmp = REG_SET(R520_MC_FB_TOP, tmp >> 16);
100 tmp |= REG_SET(R520_MC_FB_START, rdev->mc.vram_location >> 16); 101 tmp |= REG_SET(R520_MC_FB_START, rdev->mc.vram_location >> 16);
101 WREG32_MC(R520_MC_FB_LOCATION, tmp); 102 WREG32_MC(R520_MC_FB_LOCATION, tmp);
@@ -176,7 +177,6 @@ void r520_gpu_init(struct radeon_device *rdev)
176 */ 177 */
177 /* workaround for RV530 */ 178 /* workaround for RV530 */
178 if (rdev->family == CHIP_RV530) { 179 if (rdev->family == CHIP_RV530) {
179 WREG32(0x4124, 1);
180 WREG32(0x4128, 0xFF); 180 WREG32(0x4128, 0xFF);
181 } 181 }
182 r420_pipes_init(rdev); 182 r420_pipes_init(rdev);
@@ -226,9 +226,20 @@ static void r520_vram_get_type(struct radeon_device *rdev)
226 226
227void r520_vram_info(struct radeon_device *rdev) 227void r520_vram_info(struct radeon_device *rdev)
228{ 228{
229 fixed20_12 a;
230
229 r520_vram_get_type(rdev); 231 r520_vram_get_type(rdev);
230 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
231 232
232 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 233 r100_vram_init_sizes(rdev);
233 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 234 /* FIXME: we should enforce default clock in case GPU is not in
235 * default setup
236 */
237 a.full = rfixed_const(100);
238 rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk);
239 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a);
240}
241
242void r520_bandwidth_update(struct radeon_device *rdev)
243{
244 rv515_bandwidth_avivo_update(rdev);
234} 245}