diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 1b5aa1fd368b..e87475c87d52 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -339,11 +339,10 @@ int r600_mc_init(struct radeon_device *rdev) | |||
339 | { | 339 | { |
340 | fixed20_12 a; | 340 | fixed20_12 a; |
341 | u32 tmp; | 341 | u32 tmp; |
342 | int chansize; | 342 | int chansize, numchan; |
343 | int r; | 343 | int r; |
344 | 344 | ||
345 | /* Get VRAM informations */ | 345 | /* Get VRAM informations */ |
346 | rdev->mc.vram_width = 128; | ||
347 | rdev->mc.vram_is_ddr = true; | 346 | rdev->mc.vram_is_ddr = true; |
348 | tmp = RREG32(RAMCFG); | 347 | tmp = RREG32(RAMCFG); |
349 | if (tmp & CHANSIZE_OVERRIDE) { | 348 | if (tmp & CHANSIZE_OVERRIDE) { |
@@ -353,17 +352,23 @@ int r600_mc_init(struct radeon_device *rdev) | |||
353 | } else { | 352 | } else { |
354 | chansize = 32; | 353 | chansize = 32; |
355 | } | 354 | } |
356 | if (rdev->family == CHIP_R600) { | 355 | tmp = RREG32(CHMAP); |
357 | rdev->mc.vram_width = 8 * chansize; | 356 | switch ((tmp & NOOFCHAN_MASK) >> NOOFCHAN_SHIFT) { |
358 | } else if (rdev->family == CHIP_RV670) { | 357 | case 0: |
359 | rdev->mc.vram_width = 4 * chansize; | 358 | default: |
360 | } else if ((rdev->family == CHIP_RV610) || | 359 | numchan = 1; |
361 | (rdev->family == CHIP_RV620)) { | 360 | break; |
362 | rdev->mc.vram_width = chansize; | 361 | case 1: |
363 | } else if ((rdev->family == CHIP_RV630) || | 362 | numchan = 2; |
364 | (rdev->family == CHIP_RV635)) { | 363 | break; |
365 | rdev->mc.vram_width = 2 * chansize; | 364 | case 2: |
365 | numchan = 4; | ||
366 | break; | ||
367 | case 3: | ||
368 | numchan = 8; | ||
369 | break; | ||
366 | } | 370 | } |
371 | rdev->mc.vram_width = numchan * chansize; | ||
367 | /* Could aper size report 0 ? */ | 372 | /* Could aper size report 0 ? */ |
368 | rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); | 373 | rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); |
369 | rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); | 374 | rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); |