aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_ttm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ttm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 60125ddba1e9..0b5468bfaf54 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -277,7 +277,12 @@ static int radeon_move_blit(struct ttm_buffer_object *bo,
277 DRM_ERROR("Trying to move memory with CP turned off.\n"); 277 DRM_ERROR("Trying to move memory with CP turned off.\n");
278 return -EINVAL; 278 return -EINVAL;
279 } 279 }
280 r = radeon_copy(rdev, old_start, new_start, new_mem->num_pages, fence); 280
281 BUILD_BUG_ON((PAGE_SIZE % RADEON_GPU_PAGE_SIZE) != 0);
282
283 r = radeon_copy(rdev, old_start, new_start,
284 new_mem->num_pages * (PAGE_SIZE / RADEON_GPU_PAGE_SIZE), /* GPU pages */
285 fence);
281 /* FIXME: handle copy error */ 286 /* FIXME: handle copy error */
282 r = ttm_bo_move_accel_cleanup(bo, (void *)fence, NULL, 287 r = ttm_bo_move_accel_cleanup(bo, (void *)fence, NULL,
283 evict, no_wait_reserve, no_wait_gpu, new_mem); 288 evict, no_wait_reserve, no_wait_gpu, new_mem);
@@ -450,6 +455,29 @@ static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_
450 return -EINVAL; 455 return -EINVAL;
451 mem->bus.base = rdev->mc.aper_base; 456 mem->bus.base = rdev->mc.aper_base;
452 mem->bus.is_iomem = true; 457 mem->bus.is_iomem = true;
458#ifdef __alpha__
459 /*
460 * Alpha: use bus.addr to hold the ioremap() return,
461 * so we can modify bus.base below.
462 */
463 if (mem->placement & TTM_PL_FLAG_WC)
464 mem->bus.addr =
465 ioremap_wc(mem->bus.base + mem->bus.offset,
466 mem->bus.size);
467 else
468 mem->bus.addr =
469 ioremap_nocache(mem->bus.base + mem->bus.offset,
470 mem->bus.size);
471
472 /*
473 * Alpha: Use just the bus offset plus
474 * the hose/domain memory base for bus.base.
475 * It then can be used to build PTEs for VRAM
476 * access, as done in ttm_bo_vm_fault().
477 */
478 mem->bus.base = (mem->bus.base & 0x0ffffffffUL) +
479 rdev->ddev->hose->dense_mem_base;
480#endif
453 break; 481 break;
454 default: 482 default:
455 return -EINVAL; 483 return -EINVAL;