diff options
author | Jay Estabrook <jay.estabrook@gmail.com> | 2011-07-06 19:57:13 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-08-22 04:31:08 -0400 |
commit | ffb57c4b8612c31204b06713770f6df4b8a94e4f (patch) | |
tree | f21fa0e39c45dee70b5c0d82954fcf161eb5af26 /drivers/gpu | |
parent | 3210d190dcb717c328d74f8c3f69ec717d665b40 (diff) |
drm/radeon/alpha: Add Alpha support to Radeon DRM code
Alpha needs to have available the system bus address for the Radeon's
local memory, so that it can be used in ttm_bo_vm_fault(), when building
the PTEs for accessing that VRAM. So, we make bus.addr hold the ioremap()
return, and then we can modify bus.base appropriately for use during page
fault processing.
Signed-off-by: Jay Estabrook <jay.estabrook@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_ttm.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 60125ddba1e9..9b86fb0e4122 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c | |||
@@ -450,6 +450,29 @@ static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_ | |||
450 | return -EINVAL; | 450 | return -EINVAL; |
451 | mem->bus.base = rdev->mc.aper_base; | 451 | mem->bus.base = rdev->mc.aper_base; |
452 | mem->bus.is_iomem = true; | 452 | mem->bus.is_iomem = true; |
453 | #ifdef __alpha__ | ||
454 | /* | ||
455 | * Alpha: use bus.addr to hold the ioremap() return, | ||
456 | * so we can modify bus.base below. | ||
457 | */ | ||
458 | if (mem->placement & TTM_PL_FLAG_WC) | ||
459 | mem->bus.addr = | ||
460 | ioremap_wc(mem->bus.base + mem->bus.offset, | ||
461 | mem->bus.size); | ||
462 | else | ||
463 | mem->bus.addr = | ||
464 | ioremap_nocache(mem->bus.base + mem->bus.offset, | ||
465 | mem->bus.size); | ||
466 | |||
467 | /* | ||
468 | * Alpha: Use just the bus offset plus | ||
469 | * the hose/domain memory base for bus.base. | ||
470 | * It then can be used to build PTEs for VRAM | ||
471 | * access, as done in ttm_bo_vm_fault(). | ||
472 | */ | ||
473 | mem->bus.base = (mem->bus.base & 0x0ffffffffUL) + | ||
474 | rdev->ddev->hose->dense_mem_base; | ||
475 | #endif | ||
453 | break; | 476 | break; |
454 | default: | 477 | default: |
455 | return -EINVAL; | 478 | return -EINVAL; |