Commit 2966141a authored by Dave Airlie's avatar Dave Airlie

drm/ttm: rename ttm_mem_reg to ttm_resource.

This name better reflects what the object does. I didn't rename
all the pointers it seemed too messy.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-60-airlied@gmail.com
parent 9de59bc2
...@@ -171,7 +171,7 @@ void amdgpu_gtt_mgr_fini(struct amdgpu_device *adev) ...@@ -171,7 +171,7 @@ void amdgpu_gtt_mgr_fini(struct amdgpu_device *adev)
* *
* Check if a mem object has already address space allocated. * Check if a mem object has already address space allocated.
*/ */
bool amdgpu_gtt_mgr_has_gart_addr(struct ttm_mem_reg *mem) bool amdgpu_gtt_mgr_has_gart_addr(struct ttm_resource *mem)
{ {
return mem->mm_node != NULL; return mem->mm_node != NULL;
} }
...@@ -189,7 +189,7 @@ bool amdgpu_gtt_mgr_has_gart_addr(struct ttm_mem_reg *mem) ...@@ -189,7 +189,7 @@ bool amdgpu_gtt_mgr_has_gart_addr(struct ttm_mem_reg *mem)
static int amdgpu_gtt_mgr_new(struct ttm_resource_manager *man, static int amdgpu_gtt_mgr_new(struct ttm_resource_manager *man,
struct ttm_buffer_object *tbo, struct ttm_buffer_object *tbo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct amdgpu_gtt_mgr *mgr = to_gtt_mgr(man); struct amdgpu_gtt_mgr *mgr = to_gtt_mgr(man);
struct amdgpu_gtt_node *node; struct amdgpu_gtt_node *node;
...@@ -252,7 +252,7 @@ static int amdgpu_gtt_mgr_new(struct ttm_resource_manager *man, ...@@ -252,7 +252,7 @@ static int amdgpu_gtt_mgr_new(struct ttm_resource_manager *man,
* Free the allocated GTT again. * Free the allocated GTT again.
*/ */
static void amdgpu_gtt_mgr_del(struct ttm_resource_manager *man, static void amdgpu_gtt_mgr_del(struct ttm_resource_manager *man,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct amdgpu_gtt_mgr *mgr = to_gtt_mgr(man); struct amdgpu_gtt_mgr *mgr = to_gtt_mgr(man);
struct amdgpu_gtt_node *node = mem->mm_node; struct amdgpu_gtt_node *node = mem->mm_node;
......
...@@ -1268,11 +1268,11 @@ int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer, ...@@ -1268,11 +1268,11 @@ int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer,
*/ */
void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
bool evict, bool evict,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev); struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
struct amdgpu_bo *abo; struct amdgpu_bo *abo;
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
if (!amdgpu_bo_is_amdgpu_bo(bo)) if (!amdgpu_bo_is_amdgpu_bo(bo))
return; return;
......
...@@ -283,7 +283,7 @@ int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer, ...@@ -283,7 +283,7 @@ int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer,
uint64_t *flags); uint64_t *flags);
void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
bool evict, bool evict,
struct ttm_mem_reg *new_mem); struct ttm_resource *new_mem);
void amdgpu_bo_release_notify(struct ttm_buffer_object *bo); void amdgpu_bo_release_notify(struct ttm_buffer_object *bo);
int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo); int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence, void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence,
......
...@@ -182,9 +182,9 @@ static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp) ...@@ -182,9 +182,9 @@ static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp)
* Assign the memory from new_mem to the memory of the buffer object bo. * Assign the memory from new_mem to the memory of the buffer object bo.
*/ */
static void amdgpu_move_null(struct ttm_buffer_object *bo, static void amdgpu_move_null(struct ttm_buffer_object *bo,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
BUG_ON(old_mem->mm_node != NULL); BUG_ON(old_mem->mm_node != NULL);
*old_mem = *new_mem; *old_mem = *new_mem;
...@@ -201,7 +201,7 @@ static void amdgpu_move_null(struct ttm_buffer_object *bo, ...@@ -201,7 +201,7 @@ static void amdgpu_move_null(struct ttm_buffer_object *bo,
*/ */
static uint64_t amdgpu_mm_node_addr(struct ttm_buffer_object *bo, static uint64_t amdgpu_mm_node_addr(struct ttm_buffer_object *bo,
struct drm_mm_node *mm_node, struct drm_mm_node *mm_node,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
uint64_t addr = 0; uint64_t addr = 0;
...@@ -221,7 +221,7 @@ static uint64_t amdgpu_mm_node_addr(struct ttm_buffer_object *bo, ...@@ -221,7 +221,7 @@ static uint64_t amdgpu_mm_node_addr(struct ttm_buffer_object *bo,
* @offset: The offset that drm_mm_node is used for finding. * @offset: The offset that drm_mm_node is used for finding.
* *
*/ */
static struct drm_mm_node *amdgpu_find_mm_node(struct ttm_mem_reg *mem, static struct drm_mm_node *amdgpu_find_mm_node(struct ttm_resource *mem,
uint64_t *offset) uint64_t *offset)
{ {
struct drm_mm_node *mm_node = mem->mm_node; struct drm_mm_node *mm_node = mem->mm_node;
...@@ -249,7 +249,7 @@ static struct drm_mm_node *amdgpu_find_mm_node(struct ttm_mem_reg *mem, ...@@ -249,7 +249,7 @@ static struct drm_mm_node *amdgpu_find_mm_node(struct ttm_mem_reg *mem,
* the physical address for local memory. * the physical address for local memory.
*/ */
static int amdgpu_ttm_map_buffer(struct ttm_buffer_object *bo, static int amdgpu_ttm_map_buffer(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
struct drm_mm_node *mm_node, struct drm_mm_node *mm_node,
unsigned num_pages, uint64_t offset, unsigned num_pages, uint64_t offset,
unsigned window, struct amdgpu_ring *ring, unsigned window, struct amdgpu_ring *ring,
...@@ -473,8 +473,8 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev, ...@@ -473,8 +473,8 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
*/ */
static int amdgpu_move_blit(struct ttm_buffer_object *bo, static int amdgpu_move_blit(struct ttm_buffer_object *bo,
bool evict, bool no_wait_gpu, bool evict, bool no_wait_gpu,
struct ttm_mem_reg *new_mem, struct ttm_resource *new_mem,
struct ttm_mem_reg *old_mem) struct ttm_resource *old_mem)
{ {
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev); struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
struct amdgpu_bo *abo = ttm_to_amdgpu_bo(bo); struct amdgpu_bo *abo = ttm_to_amdgpu_bo(bo);
...@@ -533,10 +533,10 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo, ...@@ -533,10 +533,10 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
*/ */
static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict, static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
struct ttm_mem_reg tmp_mem; struct ttm_resource tmp_mem;
struct ttm_place placements; struct ttm_place placements;
struct ttm_placement placement; struct ttm_placement placement;
int r; int r;
...@@ -589,10 +589,10 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict, ...@@ -589,10 +589,10 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
*/ */
static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict, static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
struct ttm_mem_reg tmp_mem; struct ttm_resource tmp_mem;
struct ttm_placement placement; struct ttm_placement placement;
struct ttm_place placements; struct ttm_place placements;
int r; int r;
...@@ -635,7 +635,7 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict, ...@@ -635,7 +635,7 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict,
* Called by amdgpu_bo_move() * Called by amdgpu_bo_move()
*/ */
static bool amdgpu_mem_visible(struct amdgpu_device *adev, static bool amdgpu_mem_visible(struct amdgpu_device *adev,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct drm_mm_node *nodes = mem->mm_node; struct drm_mm_node *nodes = mem->mm_node;
...@@ -645,7 +645,7 @@ static bool amdgpu_mem_visible(struct amdgpu_device *adev, ...@@ -645,7 +645,7 @@ static bool amdgpu_mem_visible(struct amdgpu_device *adev,
if (mem->mem_type != TTM_PL_VRAM) if (mem->mem_type != TTM_PL_VRAM)
return false; return false;
/* ttm_mem_reg_ioremap only supports contiguous memory */ /* ttm_resource_ioremap only supports contiguous memory */
if (nodes->size != mem->num_pages) if (nodes->size != mem->num_pages)
return false; return false;
...@@ -660,11 +660,11 @@ static bool amdgpu_mem_visible(struct amdgpu_device *adev, ...@@ -660,11 +660,11 @@ static bool amdgpu_mem_visible(struct amdgpu_device *adev,
*/ */
static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct amdgpu_device *adev; struct amdgpu_device *adev;
struct amdgpu_bo *abo; struct amdgpu_bo *abo;
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
int r; int r;
/* Can't move a pinned BO */ /* Can't move a pinned BO */
...@@ -746,7 +746,7 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, ...@@ -746,7 +746,7 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
* *
* Called by ttm_mem_io_reserve() ultimately via ttm_bo_vm_fault() * Called by ttm_mem_io_reserve() ultimately via ttm_bo_vm_fault()
*/ */
static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resource *mem)
{ {
struct amdgpu_device *adev = amdgpu_ttm_adev(bdev); struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
struct drm_mm_node *mm_node = mem->mm_node; struct drm_mm_node *mm_node = mem->mm_node;
...@@ -770,7 +770,7 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_ ...@@ -770,7 +770,7 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_
return -EINVAL; return -EINVAL;
/* Only physically contiguous buffers apply. In a contiguous /* Only physically contiguous buffers apply. In a contiguous
* buffer, size of the first mm_node would match the number of * buffer, size of the first mm_node would match the number of
* pages in ttm_mem_reg. * pages in ttm_resource.
*/ */
if (adev->mman.aper_base_kaddr && if (adev->mman.aper_base_kaddr &&
(mm_node->size == mem->num_pages)) (mm_node->size == mem->num_pages))
...@@ -1115,7 +1115,7 @@ int amdgpu_ttm_gart_bind(struct amdgpu_device *adev, ...@@ -1115,7 +1115,7 @@ int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
* This handles binding GTT memory to the device address space. * This handles binding GTT memory to the device address space.
*/ */
static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm, static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm,
struct ttm_mem_reg *bo_mem) struct ttm_resource *bo_mem)
{ {
struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev);
struct amdgpu_ttm_tt *gtt = (void*)ttm; struct amdgpu_ttm_tt *gtt = (void*)ttm;
...@@ -1166,7 +1166,7 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo) ...@@ -1166,7 +1166,7 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo)
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev); struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
struct ttm_operation_ctx ctx = { false, false }; struct ttm_operation_ctx ctx = { false, false };
struct amdgpu_ttm_tt *gtt = (void*)bo->ttm; struct amdgpu_ttm_tt *gtt = (void*)bo->ttm;
struct ttm_mem_reg tmp; struct ttm_resource tmp;
struct ttm_placement placement; struct ttm_placement placement;
struct ttm_place placements; struct ttm_place placements;
uint64_t addr, flags; uint64_t addr, flags;
...@@ -1507,7 +1507,7 @@ bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm) ...@@ -1507,7 +1507,7 @@ bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm)
* *
* Figure out the flags to use for a VM PDE (Page Directory Entry). * Figure out the flags to use for a VM PDE (Page Directory Entry).
*/ */
uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_mem_reg *mem) uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_resource *mem)
{ {
uint64_t flags = 0; uint64_t flags = 0;
...@@ -1533,7 +1533,7 @@ uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_mem_reg *mem) ...@@ -1533,7 +1533,7 @@ uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_mem_reg *mem)
* Figure out the flags to use for a VM PTE (Page Table Entry). * Figure out the flags to use for a VM PTE (Page Table Entry).
*/ */
uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
uint64_t flags = amdgpu_ttm_tt_pde_flags(ttm, mem); uint64_t flags = amdgpu_ttm_tt_pde_flags(ttm, mem);
......
...@@ -63,7 +63,7 @@ struct amdgpu_mman { ...@@ -63,7 +63,7 @@ struct amdgpu_mman {
struct amdgpu_copy_mem { struct amdgpu_copy_mem {
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
struct ttm_mem_reg *mem; struct ttm_resource *mem;
unsigned long offset; unsigned long offset;
}; };
...@@ -72,13 +72,13 @@ void amdgpu_gtt_mgr_fini(struct amdgpu_device *adev); ...@@ -72,13 +72,13 @@ void amdgpu_gtt_mgr_fini(struct amdgpu_device *adev);
int amdgpu_vram_mgr_init(struct amdgpu_device *adev); int amdgpu_vram_mgr_init(struct amdgpu_device *adev);
void amdgpu_vram_mgr_fini(struct amdgpu_device *adev); void amdgpu_vram_mgr_fini(struct amdgpu_device *adev);
bool amdgpu_gtt_mgr_has_gart_addr(struct ttm_mem_reg *mem); bool amdgpu_gtt_mgr_has_gart_addr(struct ttm_resource *mem);
uint64_t amdgpu_gtt_mgr_usage(struct ttm_resource_manager *man); uint64_t amdgpu_gtt_mgr_usage(struct ttm_resource_manager *man);
int amdgpu_gtt_mgr_recover(struct ttm_resource_manager *man); int amdgpu_gtt_mgr_recover(struct ttm_resource_manager *man);
u64 amdgpu_vram_mgr_bo_visible_size(struct amdgpu_bo *bo); u64 amdgpu_vram_mgr_bo_visible_size(struct amdgpu_bo *bo);
int amdgpu_vram_mgr_alloc_sgt(struct amdgpu_device *adev, int amdgpu_vram_mgr_alloc_sgt(struct amdgpu_device *adev,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
struct device *dev, struct device *dev,
enum dma_data_direction dir, enum dma_data_direction dir,
struct sg_table **sgt); struct sg_table **sgt);
...@@ -142,9 +142,9 @@ bool amdgpu_ttm_tt_userptr_invalidated(struct ttm_tt *ttm, ...@@ -142,9 +142,9 @@ bool amdgpu_ttm_tt_userptr_invalidated(struct ttm_tt *ttm,
int *last_invalidated); int *last_invalidated);
bool amdgpu_ttm_tt_is_userptr(struct ttm_tt *ttm); bool amdgpu_ttm_tt_is_userptr(struct ttm_tt *ttm);
bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm); bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm);
uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_mem_reg *mem); uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_resource *mem);
uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev); int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev);
......
...@@ -1765,7 +1765,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va, ...@@ -1765,7 +1765,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
struct amdgpu_vm *vm = bo_va->base.vm; struct amdgpu_vm *vm = bo_va->base.vm;
struct amdgpu_bo_va_mapping *mapping; struct amdgpu_bo_va_mapping *mapping;
dma_addr_t *pages_addr = NULL; dma_addr_t *pages_addr = NULL;
struct ttm_mem_reg *mem; struct ttm_resource *mem;
struct drm_mm_node *nodes; struct drm_mm_node *nodes;
struct dma_fence **last_update; struct dma_fence **last_update;
struct dma_resv *resv; struct dma_resv *resv;
......
...@@ -272,7 +272,7 @@ static u64 amdgpu_vram_mgr_vis_size(struct amdgpu_device *adev, ...@@ -272,7 +272,7 @@ static u64 amdgpu_vram_mgr_vis_size(struct amdgpu_device *adev,
u64 amdgpu_vram_mgr_bo_visible_size(struct amdgpu_bo *bo) u64 amdgpu_vram_mgr_bo_visible_size(struct amdgpu_bo *bo)
{ {
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
struct ttm_mem_reg *mem = &bo->tbo.mem; struct ttm_resource *mem = &bo->tbo.mem;
struct drm_mm_node *nodes = mem->mm_node; struct drm_mm_node *nodes = mem->mm_node;
unsigned pages = mem->num_pages; unsigned pages = mem->num_pages;
u64 usage; u64 usage;
...@@ -292,13 +292,13 @@ u64 amdgpu_vram_mgr_bo_visible_size(struct amdgpu_bo *bo) ...@@ -292,13 +292,13 @@ u64 amdgpu_vram_mgr_bo_visible_size(struct amdgpu_bo *bo)
/** /**
* amdgpu_vram_mgr_virt_start - update virtual start address * amdgpu_vram_mgr_virt_start - update virtual start address
* *
* @mem: ttm_mem_reg to update * @mem: ttm_resource to update
* @node: just allocated node * @node: just allocated node
* *
* Calculate a virtual BO start address to easily check if everything is CPU * Calculate a virtual BO start address to easily check if everything is CPU
* accessible. * accessible.
*/ */
static void amdgpu_vram_mgr_virt_start(struct ttm_mem_reg *mem, static void amdgpu_vram_mgr_virt_start(struct ttm_resource *mem,
struct drm_mm_node *node) struct drm_mm_node *node)
{ {
unsigned long start; unsigned long start;
...@@ -324,7 +324,7 @@ static void amdgpu_vram_mgr_virt_start(struct ttm_mem_reg *mem, ...@@ -324,7 +324,7 @@ static void amdgpu_vram_mgr_virt_start(struct ttm_mem_reg *mem,
static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
struct ttm_buffer_object *tbo, struct ttm_buffer_object *tbo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct amdgpu_vram_mgr *mgr = to_vram_mgr(man); struct amdgpu_vram_mgr *mgr = to_vram_mgr(man);
struct amdgpu_device *adev = mgr->adev; struct amdgpu_device *adev = mgr->adev;
...@@ -442,7 +442,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, ...@@ -442,7 +442,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
* Free the allocated VRAM again. * Free the allocated VRAM again.
*/ */
static void amdgpu_vram_mgr_del(struct ttm_resource_manager *man, static void amdgpu_vram_mgr_del(struct ttm_resource_manager *man,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct amdgpu_vram_mgr *mgr = to_vram_mgr(man); struct amdgpu_vram_mgr *mgr = to_vram_mgr(man);
struct amdgpu_device *adev = mgr->adev; struct amdgpu_device *adev = mgr->adev;
...@@ -482,7 +482,7 @@ static void amdgpu_vram_mgr_del(struct ttm_resource_manager *man, ...@@ -482,7 +482,7 @@ static void amdgpu_vram_mgr_del(struct ttm_resource_manager *man,
* Allocate and fill a sg table from a VRAM allocation. * Allocate and fill a sg table from a VRAM allocation.
*/ */
int amdgpu_vram_mgr_alloc_sgt(struct amdgpu_device *adev, int amdgpu_vram_mgr_alloc_sgt(struct amdgpu_device *adev,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
struct device *dev, struct device *dev,
enum dma_data_direction dir, enum dma_data_direction dir,
struct sg_table **sgt) struct sg_table **sgt)
......
...@@ -653,7 +653,7 @@ static void drm_gem_vram_bo_driver_evict_flags(struct drm_gem_vram_object *gbo, ...@@ -653,7 +653,7 @@ static void drm_gem_vram_bo_driver_evict_flags(struct drm_gem_vram_object *gbo,
static void drm_gem_vram_bo_driver_move_notify(struct drm_gem_vram_object *gbo, static void drm_gem_vram_bo_driver_move_notify(struct drm_gem_vram_object *gbo,
bool evict, bool evict,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_bo_kmap_obj *kmap = &gbo->kmap; struct ttm_bo_kmap_obj *kmap = &gbo->kmap;
...@@ -1020,7 +1020,7 @@ static void bo_driver_evict_flags(struct ttm_buffer_object *bo, ...@@ -1020,7 +1020,7 @@ static void bo_driver_evict_flags(struct ttm_buffer_object *bo,
static void bo_driver_move_notify(struct ttm_buffer_object *bo, static void bo_driver_move_notify(struct ttm_buffer_object *bo,
bool evict, bool evict,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct drm_gem_vram_object *gbo; struct drm_gem_vram_object *gbo;
...@@ -1034,7 +1034,7 @@ static void bo_driver_move_notify(struct ttm_buffer_object *bo, ...@@ -1034,7 +1034,7 @@ static void bo_driver_move_notify(struct ttm_buffer_object *bo,
} }
static int bo_driver_io_mem_reserve(struct ttm_bo_device *bdev, static int bo_driver_io_mem_reserve(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct drm_vram_mm *vmm = drm_vram_mm_of_bdev(bdev); struct drm_vram_mm *vmm = drm_vram_mm_of_bdev(bdev);
......
...@@ -679,7 +679,7 @@ nve0_bo_move_init(struct nouveau_channel *chan, u32 handle) ...@@ -679,7 +679,7 @@ nve0_bo_move_init(struct nouveau_channel *chan, u32 handle)
static int static int
nve0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nve0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_resource *old_reg, struct ttm_resource *new_reg)
{ {
struct nouveau_mem *mem = nouveau_mem(old_reg); struct nouveau_mem *mem = nouveau_mem(old_reg);
int ret = RING_SPACE(chan, 10); int ret = RING_SPACE(chan, 10);
...@@ -711,7 +711,7 @@ nvc0_bo_move_init(struct nouveau_channel *chan, u32 handle) ...@@ -711,7 +711,7 @@ nvc0_bo_move_init(struct nouveau_channel *chan, u32 handle)
static int static int
nvc0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nvc0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_resource *old_reg, struct ttm_resource *new_reg)
{ {
struct nouveau_mem *mem = nouveau_mem(old_reg); struct nouveau_mem *mem = nouveau_mem(old_reg);
u64 src_offset = mem->vma[0].addr; u64 src_offset = mem->vma[0].addr;
...@@ -749,7 +749,7 @@ nvc0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -749,7 +749,7 @@ nvc0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
static int static int
nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_resource *old_reg, struct ttm_resource *new_reg)
{ {
struct nouveau_mem *mem = nouveau_mem(old_reg); struct nouveau_mem *mem = nouveau_mem(old_reg);
u64 src_offset = mem->vma[0].addr; u64 src_offset = mem->vma[0].addr;
...@@ -788,7 +788,7 @@ nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -788,7 +788,7 @@ nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
static int static int
nva3_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nva3_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_resource *old_reg, struct ttm_resource *new_reg)
{ {
struct nouveau_mem *mem = nouveau_mem(old_reg); struct nouveau_mem *mem = nouveau_mem(old_reg);
u64 src_offset = mem->vma[0].addr; u64 src_offset = mem->vma[0].addr;
...@@ -826,7 +826,7 @@ nva3_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -826,7 +826,7 @@ nva3_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
static int static int
nv98_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nv98_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_resource *old_reg, struct ttm_resource *new_reg)
{ {
struct nouveau_mem *mem = nouveau_mem(old_reg); struct nouveau_mem *mem = nouveau_mem(old_reg);
int ret = RING_SPACE(chan, 7); int ret = RING_SPACE(chan, 7);
...@@ -844,7 +844,7 @@ nv98_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -844,7 +844,7 @@ nv98_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
static int static int
nv84_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nv84_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_resource *old_reg, struct ttm_resource *new_reg)
{ {
struct nouveau_mem *mem = nouveau_mem(old_reg); struct nouveau_mem *mem = nouveau_mem(old_reg);
int ret = RING_SPACE(chan, 7); int ret = RING_SPACE(chan, 7);
...@@ -878,7 +878,7 @@ nv50_bo_move_init(struct nouveau_channel *chan, u32 handle) ...@@ -878,7 +878,7 @@ nv50_bo_move_init(struct nouveau_channel *chan, u32 handle)
static int static int
nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_resource *old_reg, struct ttm_resource *new_reg)
{ {
struct nouveau_mem *mem = nouveau_mem(old_reg); struct nouveau_mem *mem = nouveau_mem(old_reg);
u64 length = (new_reg->num_pages << PAGE_SHIFT); u64 length = (new_reg->num_pages << PAGE_SHIFT);
...@@ -965,7 +965,7 @@ nv04_bo_move_init(struct nouveau_channel *chan, u32 handle) ...@@ -965,7 +965,7 @@ nv04_bo_move_init(struct nouveau_channel *chan, u32 handle)
static inline uint32_t static inline uint32_t
nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo, nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo,
struct nouveau_channel *chan, struct ttm_mem_reg *reg) struct nouveau_channel *chan, struct ttm_resource *reg)
{ {
if (reg->mem_type == TTM_PL_TT) if (reg->mem_type == TTM_PL_TT)
return NvDmaTT; return NvDmaTT;
...@@ -974,7 +974,7 @@ nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo, ...@@ -974,7 +974,7 @@ nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo,
static int static int
nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_resource *old_reg, struct ttm_resource *new_reg)
{ {
u32 src_offset = old_reg->start << PAGE_SHIFT; u32 src_offset = old_reg->start << PAGE_SHIFT;
u32 dst_offset = new_reg->start << PAGE_SHIFT; u32 dst_offset = new_reg->start << PAGE_SHIFT;
...@@ -1020,7 +1020,7 @@ nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -1020,7 +1020,7 @@ nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
static int static int
nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo, nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo,
struct ttm_mem_reg *reg) struct ttm_resource *reg)
{ {
struct nouveau_mem *old_mem = nouveau_mem(&bo->mem); struct nouveau_mem *old_mem = nouveau_mem(&bo->mem);
struct nouveau_mem *new_mem = nouveau_mem(reg); struct nouveau_mem *new_mem = nouveau_mem(reg);
...@@ -1052,7 +1052,7 @@ nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo, ...@@ -1052,7 +1052,7 @@ nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo,
static int static int
nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
bool no_wait_gpu, struct ttm_mem_reg *new_reg) bool no_wait_gpu, struct ttm_resource *new_reg)
{ {
struct nouveau_drm *drm = nouveau_bdev(bo->bdev); struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
struct nouveau_channel *chan = drm->ttm.chan; struct nouveau_channel *chan = drm->ttm.chan;
...@@ -1062,7 +1062,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, ...@@ -1062,7 +1062,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
/* create temporary vmas for the transfer and attach them to the /* create temporary vmas for the transfer and attach them to the
* old nvkm_mem node, these will get cleaned up after ttm has * old nvkm_mem node, these will get cleaned up after ttm has
* destroyed the ttm_mem_reg * destroyed the ttm_resource
*/ */
if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
ret = nouveau_bo_move_prep(drm, bo, new_reg); ret = nouveau_bo_move_prep(drm, bo, new_reg);
...@@ -1098,7 +1098,7 @@ nouveau_bo_move_init(struct nouveau_drm *drm) ...@@ -1098,7 +1098,7 @@ nouveau_bo_move_init(struct nouveau_drm *drm)
s32 oclass; s32 oclass;
int (*exec)(struct nouveau_channel *, int (*exec)(struct nouveau_channel *,
struct ttm_buffer_object *, struct ttm_buffer_object *,
struct ttm_mem_reg *, struct ttm_mem_reg *); struct ttm_resource *, struct ttm_resource *);
int (*init)(struct nouveau_channel *, u32 handle); int (*init)(struct nouveau_channel *, u32 handle);
} _methods[] = { } _methods[] = {
{ "COPY", 4, 0xc5b5, nve0_bo_move_copy, nve0_bo_move_init }, { "COPY", 4, 0xc5b5, nve0_bo_move_copy, nve0_bo_move_init },
...@@ -1160,7 +1160,7 @@ nouveau_bo_move_init(struct nouveau_drm *drm) ...@@ -1160,7 +1160,7 @@ nouveau_bo_move_init(struct nouveau_drm *drm)
static int static int
nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr, nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr,
bool no_wait_gpu, struct ttm_mem_reg *new_reg) bool no_wait_gpu, struct ttm_resource *new_reg)
{ {
struct ttm_operation_ctx ctx = { intr, no_wait_gpu }; struct ttm_operation_ctx ctx = { intr, no_wait_gpu };
struct ttm_place placement_memtype = { struct ttm_place placement_memtype = {
...@@ -1169,7 +1169,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr, ...@@ -1169,7 +1169,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr,
.flags = TTM_PL_FLAG_TT | TTM_PL_MASK_CACHING .flags = TTM_PL_FLAG_TT | TTM_PL_MASK_CACHING
}; };
struct ttm_placement placement; struct ttm_placement placement;
struct ttm_mem_reg tmp_reg; struct ttm_resource tmp_reg;
int ret; int ret;
placement.num_placement = placement.num_busy_placement = 1; placement.num_placement = placement.num_busy_placement = 1;
...@@ -1197,7 +1197,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr, ...@@ -1197,7 +1197,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr,
static int static int
nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr, nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr,
bool no_wait_gpu, struct ttm_mem_reg *new_reg) bool no_wait_gpu, struct ttm_resource *new_reg)
{ {
struct ttm_operation_ctx ctx = { intr, no_wait_gpu }; struct ttm_operation_ctx ctx = { intr, no_wait_gpu };
struct ttm_place placement_memtype = { struct ttm_place placement_memtype = {
...@@ -1206,7 +1206,7 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr, ...@@ -1206,7 +1206,7 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr,
.flags = TTM_PL_FLAG_TT | TTM_PL_MASK_CACHING .flags = TTM_PL_FLAG_TT | TTM_PL_MASK_CACHING
}; };
struct ttm_placement placement; struct ttm_placement placement;
struct ttm_mem_reg tmp_reg; struct ttm_resource tmp_reg;
int ret; int ret;
placement.num_placement = placement.num_busy_placement = 1; placement.num_placement = placement.num_busy_placement = 1;
...@@ -1233,7 +1233,7 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr, ...@@ -1233,7 +1233,7 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr,
static void static void
nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict, nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict,
struct ttm_mem_reg *new_reg) struct ttm_resource *new_reg)
{ {
struct nouveau_mem *mem = new_reg ? nouveau_mem(new_reg) : NULL; struct nouveau_mem *mem = new_reg ? nouveau_mem(new_reg) : NULL;
struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_bo *nvbo = nouveau_bo(bo);
...@@ -1265,7 +1265,7 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict, ...@@ -1265,7 +1265,7 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict,
} }
static int static int
nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_reg, nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_resource *new_reg,
struct nouveau_drm_tile **new_tile) struct nouveau_drm_tile **new_tile)
{ {
struct nouveau_drm *drm = nouveau_bdev(bo->bdev); struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
...@@ -1301,11 +1301,11 @@ nouveau_bo_vm_cleanup(struct ttm_buffer_object *bo, ...@@ -1301,11 +1301,11 @@ nouveau_bo_vm_cleanup(struct ttm_buffer_object *bo,
static int static int
nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, nouveau_bo_move(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_reg) struct ttm_resource *new_reg)
{ {
struct nouveau_drm *drm = nouveau_bdev(bo->bdev); struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_bo *nvbo = nouveau_bo(bo);
struct ttm_mem_reg *old_reg = &bo->mem; struct ttm_resource *old_reg = &bo->mem;
struct nouveau_drm_tile *new_tile = NULL; struct nouveau_drm_tile *new_tile = NULL;
int ret = 0; int ret = 0;
...@@ -1374,7 +1374,7 @@ nouveau_bo_verify_access(struct ttm_buffer_object *bo, struct file *filp) ...@@ -1374,7 +1374,7 @@ nouveau_bo_verify_access(struct ttm_buffer_object *bo, struct file *filp)
} }
static int static int
nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg) nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resource *reg)
{ {
struct nouveau_drm *drm = nouveau_bdev(bdev); struct nouveau_drm *drm = nouveau_bdev(bdev);
struct nvkm_device *device = nvxx_device(&drm->client.device); struct nvkm_device *device = nvxx_device(&drm->client.device);
...@@ -1454,7 +1454,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg) ...@@ -1454,7 +1454,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg)
} }
static void static void
nouveau_ttm_io_mem_free(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg) nouveau_ttm_io_mem_free(struct ttm_bo_device *bdev, struct ttm_resource *reg)
{ {
struct nouveau_drm *drm = nouveau_bdev(bdev); struct nouveau_drm *drm = nouveau_bdev(bdev);
struct nouveau_mem *mem = nouveau_mem(reg); struct nouveau_mem *mem = nouveau_mem(reg);
......
...@@ -155,7 +155,7 @@ struct nouveau_drm { ...@@ -155,7 +155,7 @@ struct nouveau_drm {
atomic_t validate_sequence; atomic_t validate_sequence;
int (*move)(struct nouveau_channel *, int (*move)(struct nouveau_channel *,
struct ttm_buffer_object *, struct ttm_buffer_object *,
struct ttm_mem_reg *, struct ttm_mem_reg *); struct ttm_resource *, struct ttm_resource *);
struct nouveau_channel *chan; struct nouveau_channel *chan;
struct nvif_object copy; struct nvif_object copy;
int mtrr; int mtrr;
......
...@@ -92,7 +92,7 @@ nouveau_mem_fini(struct nouveau_mem *mem) ...@@ -92,7 +92,7 @@ nouveau_mem_fini(struct nouveau_mem *mem)
} }
int int
nouveau_mem_host(struct ttm_mem_reg *reg, struct ttm_dma_tt *tt) nouveau_mem_host(struct ttm_resource *reg, struct ttm_dma_tt *tt)
{ {
struct nouveau_mem *mem = nouveau_mem(reg); struct nouveau_mem *mem = nouveau_mem(reg);
struct nouveau_cli *cli = mem->cli; struct nouveau_cli *cli = mem->cli;
...@@ -130,7 +130,7 @@ nouveau_mem_host(struct ttm_mem_reg *reg, struct ttm_dma_tt *tt) ...@@ -130,7 +130,7 @@ nouveau_mem_host(struct ttm_mem_reg *reg, struct ttm_dma_tt *tt)
} }
int int
nouveau_mem_vram(struct ttm_mem_reg *reg, bool contig, u8 page) nouveau_mem_vram(struct ttm_resource *reg, bool contig, u8 page)
{ {
struct nouveau_mem *mem = nouveau_mem(reg); struct nouveau_mem *mem = nouveau_mem(reg);
struct nouveau_cli *cli = mem->cli; struct nouveau_cli *cli = mem->cli;
...@@ -173,7 +173,7 @@ nouveau_mem_vram(struct ttm_mem_reg *reg, bool contig, u8 page) ...@@ -173,7 +173,7 @@ nouveau_mem_vram(struct ttm_mem_reg *reg, bool contig, u8 page)
} }
void void
nouveau_mem_del(struct ttm_mem_reg *reg) nouveau_mem_del(struct ttm_resource *reg)
{ {
struct nouveau_mem *mem = nouveau_mem(reg); struct nouveau_mem *mem = nouveau_mem(reg);
nouveau_mem_fini(mem); nouveau_mem_fini(mem);
...@@ -183,7 +183,7 @@ nouveau_mem_del(struct ttm_mem_reg *reg) ...@@ -183,7 +183,7 @@ nouveau_mem_del(struct ttm_mem_reg *reg)
int int
nouveau_mem_new(struct nouveau_cli *cli, u8 kind, u8 comp, nouveau_mem_new(struct nouveau_cli *cli, u8 kind, u8 comp,
struct ttm_mem_reg *reg) struct ttm_resource *reg)
{ {
struct nouveau_mem *mem; struct nouveau_mem *mem;
......
...@@ -7,7 +7,7 @@ struct ttm_dma_tt; ...@@ -7,7 +7,7 @@ struct ttm_dma_tt;
#include <nvif/vmm.h> #include <nvif/vmm.h>
static inline struct nouveau_mem * static inline struct nouveau_mem *
nouveau_mem(struct ttm_mem_reg *reg) nouveau_mem(struct ttm_resource *reg)
{ {
return reg->mm_node; return reg->mm_node;
} }
...@@ -21,10 +21,10 @@ struct nouveau_mem { ...@@ -21,10 +21,10 @@ struct nouveau_mem {
}; };
int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp, int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
struct ttm_mem_reg *); struct ttm_resource *);
void nouveau_mem_del(struct ttm_mem_reg *); void nouveau_mem_del(struct ttm_resource *);
int nouveau_mem_vram(struct ttm_mem_reg *, bool contig, u8 page); int nouveau_mem_vram(struct ttm_resource *, bool contig, u8 page);
int nouveau_mem_host(struct ttm_mem_reg *, struct ttm_dma_tt *); int nouveau_mem_host(struct ttm_resource *, struct ttm_dma_tt *);
void nouveau_mem_fini(struct nouveau_mem *); void nouveau_mem_fini(struct nouveau_mem *);
int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *); int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *);
#endif #endif
...@@ -26,7 +26,7 @@ nouveau_sgdma_destroy(struct ttm_tt *ttm) ...@@ -26,7 +26,7 @@ nouveau_sgdma_destroy(struct ttm_tt *ttm)
} }
static int static int
nv04_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *reg) nv04_sgdma_bind(struct ttm_tt *ttm, struct ttm_resource *reg)
{ {
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm; struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
struct nouveau_mem *mem = nouveau_mem(reg); struct nouveau_mem *mem = nouveau_mem(reg);
...@@ -61,7 +61,7 @@ static struct ttm_backend_func nv04_sgdma_backend = { ...@@ -61,7 +61,7 @@ static struct ttm_backend_func nv04_sgdma_backend = {
}; };
static int static int
nv50_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *reg) nv50_sgdma_bind(struct ttm_tt *ttm, struct ttm_resource *reg)
{ {
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm; struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
struct nouveau_mem *mem = nouveau_mem(reg); struct nouveau_mem *mem = nouveau_mem(reg);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <core/tegra.h> #include <core/tegra.h>
static void static void
nouveau_manager_del(struct ttm_resource_manager *man, struct ttm_mem_reg *reg) nouveau_manager_del(struct ttm_resource_manager *man, struct ttm_resource *reg)
{ {
nouveau_mem_del(reg); nouveau_mem_del(reg);
} }
...@@ -41,7 +41,7 @@ static int ...@@ -41,7 +41,7 @@ static int
nouveau_vram_manager_new(struct ttm_resource_manager *man, nouveau_vram_manager_new(struct ttm_resource_manager *man,
struct ttm_buffer_object *bo, struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *reg) struct ttm_resource *reg)
{ {
struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_bo *nvbo = nouveau_bo(bo);
struct nouveau_drm *drm = nouveau_bdev(bo->bdev); struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
...@@ -72,7 +72,7 @@ static int ...@@ -72,7 +72,7 @@ static int
nouveau_gart_manager_new(struct ttm_resource_manager *man, nouveau_gart_manager_new(struct ttm_resource_manager *man,
struct ttm_buffer_object *bo, struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *reg) struct ttm_resource *reg)
{ {
struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_bo *nvbo = nouveau_bo(bo);
struct nouveau_drm *drm = nouveau_bdev(bo->bdev); struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
...@@ -95,7 +95,7 @@ static int ...@@ -95,7 +95,7 @@ static int
nv04_gart_manager_new(struct ttm_resource_manager *man, nv04_gart_manager_new(struct ttm_resource_manager *man,
struct ttm_buffer_object *bo, struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *reg) struct ttm_resource *reg)
{ {
struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_bo *nvbo = nouveau_bo(bo);
struct nouveau_drm *drm = nouveau_bdev(bo->bdev); struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
......
...@@ -76,7 +76,7 @@ nv17_fence_context_new(struct nouveau_channel *chan) ...@@ -76,7 +76,7 @@ nv17_fence_context_new(struct nouveau_channel *chan)
{ {
struct nv10_fence_priv *priv = chan->drm->fence; struct nv10_fence_priv *priv = chan->drm->fence;
struct nv10_fence_chan *fctx; struct nv10_fence_chan *fctx;
struct ttm_mem_reg *reg = &priv->bo->bo.mem; struct ttm_resource *reg = &priv->bo->bo.mem;
u32 start = reg->start * PAGE_SIZE; u32 start = reg->start * PAGE_SIZE;
u32 limit = start + reg->size - 1; u32 limit = start + reg->size - 1;
int ret = 0; int ret = 0;
......
...@@ -37,7 +37,7 @@ nv50_fence_context_new(struct nouveau_channel *chan) ...@@ -37,7 +37,7 @@ nv50_fence_context_new(struct nouveau_channel *chan)
{ {
struct nv10_fence_priv *priv = chan->drm->fence; struct nv10_fence_priv *priv = chan->drm->fence;
struct nv10_fence_chan *fctx; struct nv10_fence_chan *fctx;
struct ttm_mem_reg *reg = &priv->bo->bo.mem; struct ttm_resource *reg = &priv->bo->bo.mem;
u32 start = reg->start * PAGE_SIZE; u32 start = reg->start * PAGE_SIZE;
u32 limit = start + reg->size - 1; u32 limit = start + reg->size - 1;
int ret; int ret;
......
...@@ -350,7 +350,7 @@ int qxl_mode_dumb_mmap(struct drm_file *filp, ...@@ -350,7 +350,7 @@ int qxl_mode_dumb_mmap(struct drm_file *filp,
int qxl_ttm_init(struct qxl_device *qdev); int qxl_ttm_init(struct qxl_device *qdev);
void qxl_ttm_fini(struct qxl_device *qdev); void qxl_ttm_fini(struct qxl_device *qdev);
int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev, int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
/* qxl image */ /* qxl image */
......
...@@ -71,7 +71,7 @@ static void qxl_evict_flags(struct ttm_buffer_object *bo, ...@@ -71,7 +71,7 @@ static void qxl_evict_flags(struct ttm_buffer_object *bo,
} }
int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev, int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct qxl_device *qdev = qxl_get_qdev(bdev); struct qxl_device *qdev = qxl_get_qdev(bdev);
...@@ -111,7 +111,7 @@ struct qxl_ttm_tt { ...@@ -111,7 +111,7 @@ struct qxl_ttm_tt {
}; };
static int qxl_ttm_backend_bind(struct ttm_tt *ttm, static int qxl_ttm_backend_bind(struct ttm_tt *ttm,
struct ttm_mem_reg *bo_mem) struct ttm_resource *bo_mem)
{ {
struct qxl_ttm_tt *gtt = (void *)ttm; struct qxl_ttm_tt *gtt = (void *)ttm;
...@@ -164,9 +164,9 @@ static struct ttm_tt *qxl_ttm_tt_create(struct ttm_buffer_object *bo, ...@@ -164,9 +164,9 @@ static struct ttm_tt *qxl_ttm_tt_create(struct ttm_buffer_object *bo,
} }
static void qxl_move_null(struct ttm_buffer_object *bo, static void qxl_move_null(struct ttm_buffer_object *bo,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
BUG_ON(old_mem->mm_node != NULL); BUG_ON(old_mem->mm_node != NULL);
*old_mem = *new_mem; *old_mem = *new_mem;
...@@ -175,9 +175,9 @@ static void qxl_move_null(struct ttm_buffer_object *bo, ...@@ -175,9 +175,9 @@ static void qxl_move_null(struct ttm_buffer_object *bo,
static int qxl_bo_move(struct ttm_buffer_object *bo, bool evict, static int qxl_bo_move(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
int ret; int ret;
ret = ttm_bo_wait(bo, ctx->interruptible, ctx->no_wait_gpu); ret = ttm_bo_wait(bo, ctx->interruptible, ctx->no_wait_gpu);
...@@ -193,7 +193,7 @@ static int qxl_bo_move(struct ttm_buffer_object *bo, bool evict, ...@@ -193,7 +193,7 @@ static int qxl_bo_move(struct ttm_buffer_object *bo, bool evict,
static void qxl_bo_move_notify(struct ttm_buffer_object *bo, static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
bool evict, bool evict,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct qxl_bo *qbo; struct qxl_bo *qbo;
struct qxl_device *qdev; struct qxl_device *qdev;
......
...@@ -2857,7 +2857,7 @@ int radeon_vm_clear_invalids(struct radeon_device *rdev, ...@@ -2857,7 +2857,7 @@ int radeon_vm_clear_invalids(struct radeon_device *rdev,
struct radeon_vm *vm); struct radeon_vm *vm);
int radeon_vm_bo_update(struct radeon_device *rdev, int radeon_vm_bo_update(struct radeon_device *rdev,
struct radeon_bo_va *bo_va, struct radeon_bo_va *bo_va,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
void radeon_vm_bo_invalidate(struct radeon_device *rdev, void radeon_vm_bo_invalidate(struct radeon_device *rdev,
struct radeon_bo *bo); struct radeon_bo *bo);
struct radeon_bo_va *radeon_vm_bo_find(struct radeon_vm *vm, struct radeon_bo_va *radeon_vm_bo_find(struct radeon_vm *vm,
......
...@@ -775,7 +775,7 @@ int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved, ...@@ -775,7 +775,7 @@ int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved,
void radeon_bo_move_notify(struct ttm_buffer_object *bo, void radeon_bo_move_notify(struct ttm_buffer_object *bo,
bool evict, bool evict,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct radeon_bo *rbo; struct radeon_bo *rbo;
......
...@@ -165,7 +165,7 @@ extern int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved, ...@@ -165,7 +165,7 @@ extern int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved,
bool force_drop); bool force_drop);
extern void radeon_bo_move_notify(struct ttm_buffer_object *bo, extern void radeon_bo_move_notify(struct ttm_buffer_object *bo,
bool evict, bool evict,
struct ttm_mem_reg *new_mem); struct ttm_resource *new_mem);
extern int radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo); extern int radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
extern int radeon_bo_get_surface_reg(struct radeon_bo *bo); extern int radeon_bo_get_surface_reg(struct radeon_bo *bo);
extern void radeon_bo_fence(struct radeon_bo *bo, struct radeon_fence *fence, extern void radeon_bo_fence(struct radeon_bo *bo, struct radeon_fence *fence,
......
...@@ -166,9 +166,9 @@ static int radeon_verify_access(struct ttm_buffer_object *bo, struct file *filp) ...@@ -166,9 +166,9 @@ static int radeon_verify_access(struct ttm_buffer_object *bo, struct file *filp)
} }
static void radeon_move_null(struct ttm_buffer_object *bo, static void radeon_move_null(struct ttm_buffer_object *bo,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
BUG_ON(old_mem->mm_node != NULL); BUG_ON(old_mem->mm_node != NULL);
*old_mem = *new_mem; *old_mem = *new_mem;
...@@ -177,8 +177,8 @@ static void radeon_move_null(struct ttm_buffer_object *bo, ...@@ -177,8 +177,8 @@ static void radeon_move_null(struct ttm_buffer_object *bo,
static int radeon_move_blit(struct ttm_buffer_object *bo, static int radeon_move_blit(struct ttm_buffer_object *bo,
bool evict, bool no_wait_gpu, bool evict, bool no_wait_gpu,
struct ttm_mem_reg *new_mem, struct ttm_resource *new_mem,
struct ttm_mem_reg *old_mem) struct ttm_resource *old_mem)
{ {
struct radeon_device *rdev; struct radeon_device *rdev;
uint64_t old_start, new_start; uint64_t old_start, new_start;
...@@ -233,11 +233,11 @@ static int radeon_move_blit(struct ttm_buffer_object *bo, ...@@ -233,11 +233,11 @@ static int radeon_move_blit(struct ttm_buffer_object *bo,
static int radeon_move_vram_ram(struct ttm_buffer_object *bo, static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
bool evict, bool interruptible, bool evict, bool interruptible,
bool no_wait_gpu, bool no_wait_gpu,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_operation_ctx ctx = { interruptible, no_wait_gpu }; struct ttm_operation_ctx ctx = { interruptible, no_wait_gpu };
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
struct ttm_mem_reg tmp_mem; struct ttm_resource tmp_mem;
struct ttm_place placements; struct ttm_place placements;
struct ttm_placement placement; struct ttm_placement placement;
int r; int r;
...@@ -278,11 +278,11 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo, ...@@ -278,11 +278,11 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
static int radeon_move_ram_vram(struct ttm_buffer_object *bo, static int radeon_move_ram_vram(struct ttm_buffer_object *bo,
bool evict, bool interruptible, bool evict, bool interruptible,
bool no_wait_gpu, bool no_wait_gpu,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_operation_ctx ctx = { interruptible, no_wait_gpu }; struct ttm_operation_ctx ctx = { interruptible, no_wait_gpu };
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
struct ttm_mem_reg tmp_mem; struct ttm_resource tmp_mem;
struct ttm_placement placement; struct ttm_placement placement;
struct ttm_place placements; struct ttm_place placements;
int r; int r;
...@@ -315,11 +315,11 @@ static int radeon_move_ram_vram(struct ttm_buffer_object *bo, ...@@ -315,11 +315,11 @@ static int radeon_move_ram_vram(struct ttm_buffer_object *bo,
static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct radeon_device *rdev; struct radeon_device *rdev;
struct radeon_bo *rbo; struct radeon_bo *rbo;
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
int r; int r;
r = ttm_bo_wait(bo, ctx->interruptible, ctx->no_wait_gpu); r = ttm_bo_wait(bo, ctx->interruptible, ctx->no_wait_gpu);
...@@ -376,7 +376,7 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, ...@@ -376,7 +376,7 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
return 0; return 0;
} }
static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resource *mem)
{ {
struct radeon_device *rdev = radeon_get_rdev(bdev); struct radeon_device *rdev = radeon_get_rdev(bdev);
...@@ -544,7 +544,7 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm) ...@@ -544,7 +544,7 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
} }
static int radeon_ttm_backend_bind(struct ttm_tt *ttm, static int radeon_ttm_backend_bind(struct ttm_tt *ttm,
struct ttm_mem_reg *bo_mem) struct ttm_resource *bo_mem)
{ {
struct radeon_ttm_tt *gtt = (void*)ttm; struct radeon_ttm_tt *gtt = (void*)ttm;
uint32_t flags = RADEON_GART_PAGE_VALID | RADEON_GART_PAGE_READ | uint32_t flags = RADEON_GART_PAGE_VALID | RADEON_GART_PAGE_READ |
......
...@@ -911,7 +911,7 @@ static void radeon_vm_fence_pts(struct radeon_vm *vm, ...@@ -911,7 +911,7 @@ static void radeon_vm_fence_pts(struct radeon_vm *vm,
*/ */
int radeon_vm_bo_update(struct radeon_device *rdev, int radeon_vm_bo_update(struct radeon_device *rdev,
struct radeon_bo_va *bo_va, struct radeon_bo_va *bo_va,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct radeon_vm *vm = bo_va->vm; struct radeon_vm *vm = bo_va->vm;
struct radeon_ib ib; struct radeon_ib ib;
......
...@@ -48,7 +48,7 @@ struct ttm_agp_backend { ...@@ -48,7 +48,7 @@ struct ttm_agp_backend {
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
}; };
static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem)
{ {
struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm);
struct page *dummy_read_page = ttm_bo_glob.dummy_read_page; struct page *dummy_read_page = ttm_bo_glob.dummy_read_page;
......
...@@ -145,7 +145,7 @@ static inline uint32_t ttm_bo_type_flags(unsigned type) ...@@ -145,7 +145,7 @@ static inline uint32_t ttm_bo_type_flags(unsigned type)
} }
static void ttm_bo_add_mem_to_lru(struct ttm_buffer_object *bo, static void ttm_bo_add_mem_to_lru(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
struct ttm_resource_manager *man; struct ttm_resource_manager *man;
...@@ -268,7 +268,7 @@ void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) ...@@ -268,7 +268,7 @@ void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk)
EXPORT_SYMBOL(ttm_bo_bulk_move_lru_tail); EXPORT_SYMBOL(ttm_bo_bulk_move_lru_tail);
static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem, bool evict, struct ttm_resource *mem, bool evict,
struct ttm_operation_ctx *ctx) struct ttm_operation_ctx *ctx)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
...@@ -642,7 +642,7 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo, ...@@ -642,7 +642,7 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
struct ttm_operation_ctx *ctx) struct ttm_operation_ctx *ctx)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
struct ttm_mem_reg evict_mem; struct ttm_resource evict_mem;
struct ttm_placement placement; struct ttm_placement placement;
int ret = 0; int ret = 0;
...@@ -841,7 +841,7 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev, ...@@ -841,7 +841,7 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
static int ttm_bo_mem_get(struct ttm_buffer_object *bo, static int ttm_bo_mem_get(struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, mem->mem_type); struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, mem->mem_type);
...@@ -852,7 +852,7 @@ static int ttm_bo_mem_get(struct ttm_buffer_object *bo, ...@@ -852,7 +852,7 @@ static int ttm_bo_mem_get(struct ttm_buffer_object *bo,
return man->func->get_node(man, bo, place, mem); return man->func->get_node(man, bo, place, mem);
} }
void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem) void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_resource *mem)
{ {
struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, mem->mem_type); struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, mem->mem_type);
...@@ -870,7 +870,7 @@ EXPORT_SYMBOL(ttm_bo_mem_put); ...@@ -870,7 +870,7 @@ EXPORT_SYMBOL(ttm_bo_mem_put);
*/ */
static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo, static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
struct ttm_resource_manager *man, struct ttm_resource_manager *man,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
bool no_wait_gpu) bool no_wait_gpu)
{ {
struct dma_fence *fence; struct dma_fence *fence;
...@@ -905,7 +905,7 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo, ...@@ -905,7 +905,7 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
*/ */
static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo, static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
struct ttm_operation_ctx *ctx) struct ttm_operation_ctx *ctx)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
...@@ -986,7 +986,7 @@ static bool ttm_bo_mt_compatible(struct ttm_resource_manager *man, ...@@ -986,7 +986,7 @@ static bool ttm_bo_mt_compatible(struct ttm_resource_manager *man,
*/ */
static int ttm_bo_mem_placement(struct ttm_buffer_object *bo, static int ttm_bo_mem_placement(struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
struct ttm_operation_ctx *ctx) struct ttm_operation_ctx *ctx)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
...@@ -1034,7 +1034,7 @@ static int ttm_bo_mem_placement(struct ttm_buffer_object *bo, ...@@ -1034,7 +1034,7 @@ static int ttm_bo_mem_placement(struct ttm_buffer_object *bo,
*/ */
int ttm_bo_mem_space(struct ttm_buffer_object *bo, int ttm_bo_mem_space(struct ttm_buffer_object *bo,
struct ttm_placement *placement, struct ttm_placement *placement,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
struct ttm_operation_ctx *ctx) struct ttm_operation_ctx *ctx)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
...@@ -1112,7 +1112,7 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo, ...@@ -1112,7 +1112,7 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
struct ttm_operation_ctx *ctx) struct ttm_operation_ctx *ctx)
{ {
int ret = 0; int ret = 0;
struct ttm_mem_reg mem; struct ttm_resource mem;
dma_resv_assert_held(bo->base.resv); dma_resv_assert_held(bo->base.resv);
...@@ -1138,7 +1138,7 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo, ...@@ -1138,7 +1138,7 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
static bool ttm_bo_places_compat(const struct ttm_place *places, static bool ttm_bo_places_compat(const struct ttm_place *places,
unsigned num_placement, unsigned num_placement,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
uint32_t *new_flags) uint32_t *new_flags)
{ {
unsigned i; unsigned i;
...@@ -1161,7 +1161,7 @@ static bool ttm_bo_places_compat(const struct ttm_place *places, ...@@ -1161,7 +1161,7 @@ static bool ttm_bo_places_compat(const struct ttm_place *places,
} }
bool ttm_bo_mem_compat(struct ttm_placement *placement, bool ttm_bo_mem_compat(struct ttm_placement *placement,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
uint32_t *new_flags) uint32_t *new_flags)
{ {
if (ttm_bo_places_compat(placement->placement, placement->num_placement, if (ttm_bo_places_compat(placement->placement, placement->num_placement,
...@@ -1730,7 +1730,7 @@ int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx) ...@@ -1730,7 +1730,7 @@ int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx)
if (bo->mem.mem_type != TTM_PL_SYSTEM || if (bo->mem.mem_type != TTM_PL_SYSTEM ||
bo->ttm->caching_state != tt_cached) { bo->ttm->caching_state != tt_cached) {
struct ttm_operation_ctx ctx = { false, false }; struct ttm_operation_ctx ctx = { false, false };
struct ttm_mem_reg evict_mem; struct ttm_resource evict_mem;
evict_mem = bo->mem; evict_mem = bo->mem;
evict_mem.mm_node = NULL; evict_mem.mm_node = NULL;
......
...@@ -52,10 +52,10 @@ void ttm_bo_free_old_node(struct ttm_buffer_object *bo) ...@@ -52,10 +52,10 @@ void ttm_bo_free_old_node(struct ttm_buffer_object *bo)
int ttm_bo_move_ttm(struct ttm_buffer_object *bo, int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_tt *ttm = bo->ttm; struct ttm_tt *ttm = bo->ttm;
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
int ret; int ret;
if (old_mem->mem_type != TTM_PL_SYSTEM) { if (old_mem->mem_type != TTM_PL_SYSTEM) {
...@@ -127,7 +127,7 @@ static int ttm_mem_io_evict(struct ttm_resource_manager *man) ...@@ -127,7 +127,7 @@ static int ttm_mem_io_evict(struct ttm_resource_manager *man)
} }
int ttm_mem_io_reserve(struct ttm_bo_device *bdev, int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct ttm_resource_manager *man = ttm_manager_type(bdev, mem->mem_type); struct ttm_resource_manager *man = ttm_manager_type(bdev, mem->mem_type);
int ret; int ret;
...@@ -149,7 +149,7 @@ int ttm_mem_io_reserve(struct ttm_bo_device *bdev, ...@@ -149,7 +149,7 @@ int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
} }
void ttm_mem_io_free(struct ttm_bo_device *bdev, void ttm_mem_io_free(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
if (--mem->bus.io_reserved_count) if (--mem->bus.io_reserved_count)
return; return;
...@@ -163,7 +163,7 @@ void ttm_mem_io_free(struct ttm_bo_device *bdev, ...@@ -163,7 +163,7 @@ void ttm_mem_io_free(struct ttm_bo_device *bdev,
int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo) int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo)
{ {
struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, bo->mem.mem_type); struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, bo->mem.mem_type);
struct ttm_mem_reg *mem = &bo->mem; struct ttm_resource *mem = &bo->mem;
int ret; int ret;
if (mem->bus.io_reserved_vm) if (mem->bus.io_reserved_vm)
...@@ -181,7 +181,7 @@ int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo) ...@@ -181,7 +181,7 @@ int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo)
void ttm_mem_io_free_vm(struct ttm_buffer_object *bo) void ttm_mem_io_free_vm(struct ttm_buffer_object *bo)
{ {
struct ttm_mem_reg *mem = &bo->mem; struct ttm_resource *mem = &bo->mem;
if (!mem->bus.io_reserved_vm) if (!mem->bus.io_reserved_vm)
return; return;
...@@ -191,8 +191,8 @@ void ttm_mem_io_free_vm(struct ttm_buffer_object *bo) ...@@ -191,8 +191,8 @@ void ttm_mem_io_free_vm(struct ttm_buffer_object *bo)
ttm_mem_io_free(bo->bdev, mem); ttm_mem_io_free(bo->bdev, mem);
} }
static int ttm_mem_reg_ioremap(struct ttm_bo_device *bdev, static int ttm_resource_ioremap(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
void **virtual) void **virtual)
{ {
struct ttm_resource_manager *man = ttm_manager_type(bdev, mem->mem_type); struct ttm_resource_manager *man = ttm_manager_type(bdev, mem->mem_type);
...@@ -226,8 +226,8 @@ static int ttm_mem_reg_ioremap(struct ttm_bo_device *bdev, ...@@ -226,8 +226,8 @@ static int ttm_mem_reg_ioremap(struct ttm_bo_device *bdev,
return 0; return 0;
} }
static void ttm_mem_reg_iounmap(struct ttm_bo_device *bdev, static void ttm_resource_iounmap(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
void *virtual) void *virtual)
{ {
struct ttm_resource_manager *man; struct ttm_resource_manager *man;
...@@ -300,13 +300,13 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, ...@@ -300,13 +300,13 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
struct ttm_resource_manager *man = ttm_manager_type(bdev, new_mem->mem_type); struct ttm_resource_manager *man = ttm_manager_type(bdev, new_mem->mem_type);
struct ttm_tt *ttm = bo->ttm; struct ttm_tt *ttm = bo->ttm;
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
struct ttm_mem_reg old_copy = *old_mem; struct ttm_resource old_copy = *old_mem;
void *old_iomap; void *old_iomap;
void *new_iomap; void *new_iomap;
int ret; int ret;
...@@ -319,10 +319,10 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, ...@@ -319,10 +319,10 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
if (ret) if (ret)
return ret; return ret;
ret = ttm_mem_reg_ioremap(bdev, old_mem, &old_iomap); ret = ttm_resource_ioremap(bdev, old_mem, &old_iomap);
if (ret) if (ret)
return ret; return ret;
ret = ttm_mem_reg_ioremap(bdev, new_mem, &new_iomap); ret = ttm_resource_ioremap(bdev, new_mem, &new_iomap);
if (ret) if (ret)
goto out; goto out;
...@@ -390,9 +390,9 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, ...@@ -390,9 +390,9 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
} }
out1: out1:
ttm_mem_reg_iounmap(bdev, old_mem, new_iomap); ttm_resource_iounmap(bdev, old_mem, new_iomap);
out: out:
ttm_mem_reg_iounmap(bdev, &old_copy, old_iomap); ttm_resource_iounmap(bdev, &old_copy, old_iomap);
/* /*
* On error, keep the mm node! * On error, keep the mm node!
...@@ -502,7 +502,7 @@ static int ttm_bo_ioremap(struct ttm_buffer_object *bo, ...@@ -502,7 +502,7 @@ static int ttm_bo_ioremap(struct ttm_buffer_object *bo,
unsigned long size, unsigned long size,
struct ttm_bo_kmap_obj *map) struct ttm_bo_kmap_obj *map)
{ {
struct ttm_mem_reg *mem = &bo->mem; struct ttm_resource *mem = &bo->mem;
if (bo->mem.bus.addr) { if (bo->mem.bus.addr) {
map->bo_kmap_type = ttm_bo_map_premapped; map->bo_kmap_type = ttm_bo_map_premapped;
...@@ -526,7 +526,7 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo, ...@@ -526,7 +526,7 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo,
unsigned long num_pages, unsigned long num_pages,
struct ttm_bo_kmap_obj *map) struct ttm_bo_kmap_obj *map)
{ {
struct ttm_mem_reg *mem = &bo->mem; struct ttm_resource *mem = &bo->mem;
struct ttm_operation_ctx ctx = { struct ttm_operation_ctx ctx = {
.interruptible = false, .interruptible = false,
.no_wait_gpu = false .no_wait_gpu = false
...@@ -631,11 +631,11 @@ EXPORT_SYMBOL(ttm_bo_kunmap); ...@@ -631,11 +631,11 @@ EXPORT_SYMBOL(ttm_bo_kunmap);
int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
struct dma_fence *fence, struct dma_fence *fence,
bool evict, bool evict,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
struct ttm_resource_manager *man = ttm_manager_type(bdev, new_mem->mem_type); struct ttm_resource_manager *man = ttm_manager_type(bdev, new_mem->mem_type);
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
int ret; int ret;
struct ttm_buffer_object *ghost_obj; struct ttm_buffer_object *ghost_obj;
...@@ -692,10 +692,10 @@ EXPORT_SYMBOL(ttm_bo_move_accel_cleanup); ...@@ -692,10 +692,10 @@ EXPORT_SYMBOL(ttm_bo_move_accel_cleanup);
int ttm_bo_pipeline_move(struct ttm_buffer_object *bo, int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
struct dma_fence *fence, bool evict, struct dma_fence *fence, bool evict,
struct ttm_mem_reg *new_mem) struct ttm_resource *new_mem)
{ {
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_resource *old_mem = &bo->mem;
struct ttm_resource_manager *from = ttm_manager_type(bdev, old_mem->mem_type); struct ttm_resource_manager *from = ttm_manager_type(bdev, old_mem->mem_type);
struct ttm_resource_manager *to = ttm_manager_type(bdev, new_mem->mem_type); struct ttm_resource_manager *to = ttm_manager_type(bdev, new_mem->mem_type);
......
...@@ -57,7 +57,7 @@ static inline struct ttm_range_manager *to_range_manager(struct ttm_resource_man ...@@ -57,7 +57,7 @@ static inline struct ttm_range_manager *to_range_manager(struct ttm_resource_man
static int ttm_range_man_get_node(struct ttm_resource_manager *man, static int ttm_range_man_get_node(struct ttm_resource_manager *man,
struct ttm_buffer_object *bo, struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct ttm_range_manager *rman = to_range_manager(man); struct ttm_range_manager *rman = to_range_manager(man);
struct drm_mm *mm = &rman->mm; struct drm_mm *mm = &rman->mm;
...@@ -96,7 +96,7 @@ static int ttm_range_man_get_node(struct ttm_resource_manager *man, ...@@ -96,7 +96,7 @@ static int ttm_range_man_get_node(struct ttm_resource_manager *man,
} }
static void ttm_range_man_put_node(struct ttm_resource_manager *man, static void ttm_range_man_put_node(struct ttm_resource_manager *man,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct ttm_range_manager *rman = to_range_manager(man); struct ttm_range_manager *rman = to_range_manager(man);
......
...@@ -322,7 +322,7 @@ void ttm_tt_unbind(struct ttm_tt *ttm) ...@@ -322,7 +322,7 @@ void ttm_tt_unbind(struct ttm_tt *ttm)
} }
} }
int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem, int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem,
struct ttm_operation_ctx *ctx) struct ttm_operation_ctx *ctx)
{ {
int ret = 0; int ret = 0;
......
...@@ -1135,14 +1135,14 @@ void vmw_bo_swap_notify(struct ttm_buffer_object *bo) ...@@ -1135,14 +1135,14 @@ void vmw_bo_swap_notify(struct ttm_buffer_object *bo)
* vmw_bo_move_notify - TTM move_notify_callback * vmw_bo_move_notify - TTM move_notify_callback
* *
* @bo: The TTM buffer object about to move. * @bo: The TTM buffer object about to move.
* @mem: The struct ttm_mem_reg indicating to what memory * @mem: The struct ttm_resource indicating to what memory
* region the move is taking place. * region the move is taking place.
* *
* Detaches cached maps and device bindings that require that the * Detaches cached maps and device bindings that require that the
* buffer doesn't move. * buffer doesn't move.
*/ */
void vmw_bo_move_notify(struct ttm_buffer_object *bo, void vmw_bo_move_notify(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct vmw_buffer_object *vbo; struct vmw_buffer_object *vbo;
......
...@@ -793,7 +793,7 @@ extern void vmw_resource_unreserve(struct vmw_resource *res, ...@@ -793,7 +793,7 @@ extern void vmw_resource_unreserve(struct vmw_resource *res,
struct vmw_buffer_object *new_backup, struct vmw_buffer_object *new_backup,
unsigned long new_backup_offset); unsigned long new_backup_offset);
extern void vmw_query_move_notify(struct ttm_buffer_object *bo, extern void vmw_query_move_notify(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
extern int vmw_query_readback_all(struct vmw_buffer_object *dx_query_mob); extern int vmw_query_readback_all(struct vmw_buffer_object *dx_query_mob);
extern void vmw_resource_evict_all(struct vmw_private *dev_priv); extern void vmw_resource_evict_all(struct vmw_private *dev_priv);
extern void vmw_resource_unbind_list(struct vmw_buffer_object *vbo); extern void vmw_resource_unbind_list(struct vmw_buffer_object *vbo);
...@@ -878,7 +878,7 @@ extern void vmw_bo_fence_single(struct ttm_buffer_object *bo, ...@@ -878,7 +878,7 @@ extern void vmw_bo_fence_single(struct ttm_buffer_object *bo,
extern void *vmw_bo_map_and_cache(struct vmw_buffer_object *vbo); extern void *vmw_bo_map_and_cache(struct vmw_buffer_object *vbo);
extern void vmw_bo_unmap(struct vmw_buffer_object *vbo); extern void vmw_bo_unmap(struct vmw_buffer_object *vbo);
extern void vmw_bo_move_notify(struct ttm_buffer_object *bo, extern void vmw_bo_move_notify(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
extern void vmw_bo_swap_notify(struct ttm_buffer_object *bo); extern void vmw_bo_swap_notify(struct ttm_buffer_object *bo);
extern struct vmw_buffer_object * extern struct vmw_buffer_object *
vmw_user_bo_noref_lookup(struct ttm_object_file *tfile, u32 handle); vmw_user_bo_noref_lookup(struct ttm_object_file *tfile, u32 handle);
......
...@@ -53,7 +53,7 @@ static struct vmwgfx_gmrid_man *to_gmrid_manager(struct ttm_resource_manager *ma ...@@ -53,7 +53,7 @@ static struct vmwgfx_gmrid_man *to_gmrid_manager(struct ttm_resource_manager *ma
static int vmw_gmrid_man_get_node(struct ttm_resource_manager *man, static int vmw_gmrid_man_get_node(struct ttm_resource_manager *man,
struct ttm_buffer_object *bo, struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct vmwgfx_gmrid_man *gman = to_gmrid_manager(man); struct vmwgfx_gmrid_man *gman = to_gmrid_manager(man);
int id; int id;
...@@ -85,7 +85,7 @@ static int vmw_gmrid_man_get_node(struct ttm_resource_manager *man, ...@@ -85,7 +85,7 @@ static int vmw_gmrid_man_get_node(struct ttm_resource_manager *man,
} }
static void vmw_gmrid_man_put_node(struct ttm_resource_manager *man, static void vmw_gmrid_man_put_node(struct ttm_resource_manager *man,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct vmwgfx_gmrid_man *gman = to_gmrid_manager(man); struct vmwgfx_gmrid_man *gman = to_gmrid_manager(man);
......
...@@ -855,7 +855,7 @@ int vmw_query_readback_all(struct vmw_buffer_object *dx_query_mob) ...@@ -855,7 +855,7 @@ int vmw_query_readback_all(struct vmw_buffer_object *dx_query_mob)
* states from the device. * states from the device.
*/ */
void vmw_query_move_notify(struct ttm_buffer_object *bo, void vmw_query_move_notify(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct vmw_buffer_object *dx_query_mob; struct vmw_buffer_object *dx_query_mob;
struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_device *bdev = bo->bdev;
......
...@@ -29,7 +29,7 @@ static struct vmw_thp_manager *to_thp_manager(struct ttm_resource_manager *man) ...@@ -29,7 +29,7 @@ static struct vmw_thp_manager *to_thp_manager(struct ttm_resource_manager *man)
static int vmw_thp_insert_aligned(struct drm_mm *mm, struct drm_mm_node *node, static int vmw_thp_insert_aligned(struct drm_mm *mm, struct drm_mm_node *node,
unsigned long align_pages, unsigned long align_pages,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
unsigned long lpfn, unsigned long lpfn,
enum drm_mm_insert_mode mode) enum drm_mm_insert_mode mode)
{ {
...@@ -47,7 +47,7 @@ static int vmw_thp_insert_aligned(struct drm_mm *mm, struct drm_mm_node *node, ...@@ -47,7 +47,7 @@ static int vmw_thp_insert_aligned(struct drm_mm *mm, struct drm_mm_node *node,
static int vmw_thp_get_node(struct ttm_resource_manager *man, static int vmw_thp_get_node(struct ttm_resource_manager *man,
struct ttm_buffer_object *bo, struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct vmw_thp_manager *rman = to_thp_manager(man); struct vmw_thp_manager *rman = to_thp_manager(man);
struct drm_mm *mm = &rman->mm; struct drm_mm *mm = &rman->mm;
...@@ -107,7 +107,7 @@ static int vmw_thp_get_node(struct ttm_resource_manager *man, ...@@ -107,7 +107,7 @@ static int vmw_thp_get_node(struct ttm_resource_manager *man,
static void vmw_thp_put_node(struct ttm_resource_manager *man, static void vmw_thp_put_node(struct ttm_resource_manager *man,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
struct vmw_thp_manager *rman = to_thp_manager(man); struct vmw_thp_manager *rman = to_thp_manager(man);
......
...@@ -539,7 +539,7 @@ const struct vmw_sg_table *vmw_bo_sg_table(struct ttm_buffer_object *bo) ...@@ -539,7 +539,7 @@ const struct vmw_sg_table *vmw_bo_sg_table(struct ttm_buffer_object *bo)
} }
static int vmw_ttm_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) static int vmw_ttm_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem)
{ {
struct vmw_ttm_tt *vmw_be = struct vmw_ttm_tt *vmw_be =
container_of(ttm, struct vmw_ttm_tt, dma_ttm.ttm); container_of(ttm, struct vmw_ttm_tt, dma_ttm.ttm);
...@@ -713,7 +713,7 @@ static int vmw_verify_access(struct ttm_buffer_object *bo, struct file *filp) ...@@ -713,7 +713,7 @@ static int vmw_verify_access(struct ttm_buffer_object *bo, struct file *filp)
return vmw_user_bo_verify_access(bo, tfile); return vmw_user_bo_verify_access(bo, tfile);
} }
static int vmw_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) static int vmw_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resource *mem)
{ {
struct vmw_private *dev_priv = container_of(bdev, struct vmw_private, bdev); struct vmw_private *dev_priv = container_of(bdev, struct vmw_private, bdev);
...@@ -743,7 +743,7 @@ static int vmw_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg ...@@ -743,7 +743,7 @@ static int vmw_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg
* vmw_move_notify - TTM move_notify_callback * vmw_move_notify - TTM move_notify_callback
* *
* @bo: The TTM buffer object about to move. * @bo: The TTM buffer object about to move.
* @mem: The struct ttm_mem_reg indicating to what memory * @mem: The struct ttm_resource indicating to what memory
* region the move is taking place. * region the move is taking place.
* *
* Calls move_notify for all subsystems needing it. * Calls move_notify for all subsystems needing it.
...@@ -751,7 +751,7 @@ static int vmw_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg ...@@ -751,7 +751,7 @@ static int vmw_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg
*/ */
static void vmw_move_notify(struct ttm_buffer_object *bo, static void vmw_move_notify(struct ttm_buffer_object *bo,
bool evict, bool evict,
struct ttm_mem_reg *mem) struct ttm_resource *mem)
{ {
vmw_bo_move_notify(bo, mem); vmw_bo_move_notify(bo, mem);
vmw_query_move_notify(bo, mem); vmw_query_move_notify(bo, mem);
......
...@@ -81,7 +81,7 @@ struct ttm_bus_placement { ...@@ -81,7 +81,7 @@ struct ttm_bus_placement {
/** /**
* struct ttm_mem_reg * struct ttm_resource
* *
* @mm_node: Memory manager node. * @mm_node: Memory manager node.
* @size: Requested size of memory region. * @size: Requested size of memory region.
...@@ -94,7 +94,7 @@ struct ttm_bus_placement { ...@@ -94,7 +94,7 @@ struct ttm_bus_placement {
* buffer object. * buffer object.
*/ */
struct ttm_mem_reg { struct ttm_resource {
void *mm_node; void *mm_node;
unsigned long start; unsigned long start;
unsigned long size; unsigned long size;
...@@ -187,7 +187,7 @@ struct ttm_buffer_object { ...@@ -187,7 +187,7 @@ struct ttm_buffer_object {
* Members protected by the bo::resv::reserved lock. * Members protected by the bo::resv::reserved lock.
*/ */
struct ttm_mem_reg mem; struct ttm_resource mem;
struct file *persistent_swap_storage; struct file *persistent_swap_storage;
struct ttm_tt *ttm; struct ttm_tt *ttm;
bool evicted; bool evicted;
...@@ -316,12 +316,12 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, bool interruptible, bool no_wait); ...@@ -316,12 +316,12 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, bool interruptible, bool no_wait);
* ttm_bo_mem_compat - Check if proposed placement is compatible with a bo * ttm_bo_mem_compat - Check if proposed placement is compatible with a bo
* *
* @placement: Return immediately if buffer is busy. * @placement: Return immediately if buffer is busy.
* @mem: The struct ttm_mem_reg indicating the region where the bo resides * @mem: The struct ttm_resource indicating the region where the bo resides
* @new_flags: Describes compatible placement found * @new_flags: Describes compatible placement found
* *
* Returns true if the placement is compatible * Returns true if the placement is compatible
*/ */
bool ttm_bo_mem_compat(struct ttm_placement *placement, struct ttm_mem_reg *mem, bool ttm_bo_mem_compat(struct ttm_placement *placement, struct ttm_resource *mem,
uint32_t *new_flags); uint32_t *new_flags);
/** /**
......
...@@ -55,7 +55,7 @@ struct ttm_resource_manager_func { ...@@ -55,7 +55,7 @@ struct ttm_resource_manager_func {
* @bo: Pointer to the buffer object we're allocating space for. * @bo: Pointer to the buffer object we're allocating space for.
* @placement: Placement details. * @placement: Placement details.
* @flags: Additional placement flags. * @flags: Additional placement flags.
* @mem: Pointer to a struct ttm_mem_reg to be filled in. * @mem: Pointer to a struct ttm_resource to be filled in.
* *
* This function should allocate space in the memory type managed * This function should allocate space in the memory type managed
* by @man. Placement details if * by @man. Placement details if
...@@ -79,20 +79,20 @@ struct ttm_resource_manager_func { ...@@ -79,20 +79,20 @@ struct ttm_resource_manager_func {
int (*get_node)(struct ttm_resource_manager *man, int (*get_node)(struct ttm_resource_manager *man,
struct ttm_buffer_object *bo, struct ttm_buffer_object *bo,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
/** /**
* struct ttm_resource_manager member put_node * struct ttm_resource_manager member put_node
* *
* @man: Pointer to a memory type manager. * @man: Pointer to a memory type manager.
* @mem: Pointer to a struct ttm_mem_reg to be filled in. * @mem: Pointer to a struct ttm_resource to be filled in.
* *
* This function frees memory type resources previously allocated * This function frees memory type resources previously allocated
* and that are identified by @mem::mm_node and @mem::start. May not * and that are identified by @mem::mm_node and @mem::start. May not
* be called from within atomic context. * be called from within atomic context.
*/ */
void (*put_node)(struct ttm_resource_manager *man, void (*put_node)(struct ttm_resource_manager *man,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
/** /**
* struct ttm_resource_manager member debug * struct ttm_resource_manager member debug
...@@ -251,7 +251,7 @@ struct ttm_bo_driver { ...@@ -251,7 +251,7 @@ struct ttm_bo_driver {
*/ */
int (*move)(struct ttm_buffer_object *bo, bool evict, int (*move)(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem); struct ttm_resource *new_mem);
/** /**
* struct ttm_bo_driver_member verify_access * struct ttm_bo_driver_member verify_access
...@@ -277,7 +277,7 @@ struct ttm_bo_driver { ...@@ -277,7 +277,7 @@ struct ttm_bo_driver {
*/ */
void (*move_notify)(struct ttm_buffer_object *bo, void (*move_notify)(struct ttm_buffer_object *bo,
bool evict, bool evict,
struct ttm_mem_reg *new_mem); struct ttm_resource *new_mem);
/* notify the driver we are taking a fault on this BO /* notify the driver we are taking a fault on this BO
* and have reserved it */ * and have reserved it */
int (*fault_reserve_notify)(struct ttm_buffer_object *bo); int (*fault_reserve_notify)(struct ttm_buffer_object *bo);
...@@ -294,9 +294,9 @@ struct ttm_bo_driver { ...@@ -294,9 +294,9 @@ struct ttm_bo_driver {
* are balanced. * are balanced.
*/ */
int (*io_mem_reserve)(struct ttm_bo_device *bdev, int (*io_mem_reserve)(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
void (*io_mem_free)(struct ttm_bo_device *bdev, void (*io_mem_free)(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
/** /**
* Return the pfn for a given page_offset inside the BO. * Return the pfn for a given page_offset inside the BO.
...@@ -503,15 +503,15 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask) ...@@ -503,15 +503,15 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask)
*/ */
/** /**
* ttm_mem_reg_is_pci * ttm_resource_is_pci
* *
* @bdev: Pointer to a struct ttm_bo_device. * @bdev: Pointer to a struct ttm_bo_device.
* @mem: A valid struct ttm_mem_reg. * @mem: A valid struct ttm_resource.
* *
* Returns true if the memory described by @mem is PCI memory, * Returns true if the memory described by @mem is PCI memory,
* false otherwise. * false otherwise.
*/ */
bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); bool ttm_resource_is_pci(struct ttm_bo_device *bdev, struct ttm_resource *mem);
/** /**
* ttm_bo_mem_space * ttm_bo_mem_space
...@@ -519,7 +519,7 @@ bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); ...@@ -519,7 +519,7 @@ bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem);
* @bo: Pointer to a struct ttm_buffer_object. the data of which * @bo: Pointer to a struct ttm_buffer_object. the data of which
* we want to allocate space for. * we want to allocate space for.
* @proposed_placement: Proposed new placement for the buffer object. * @proposed_placement: Proposed new placement for the buffer object.
* @mem: A struct ttm_mem_reg. * @mem: A struct ttm_resource.
* @interruptible: Sleep interruptible when sliping. * @interruptible: Sleep interruptible when sliping.
* @no_wait_gpu: Return immediately if the GPU is busy. * @no_wait_gpu: Return immediately if the GPU is busy.
* *
...@@ -534,10 +534,10 @@ bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); ...@@ -534,10 +534,10 @@ bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem);
*/ */
int ttm_bo_mem_space(struct ttm_buffer_object *bo, int ttm_bo_mem_space(struct ttm_buffer_object *bo,
struct ttm_placement *placement, struct ttm_placement *placement,
struct ttm_mem_reg *mem, struct ttm_resource *mem,
struct ttm_operation_ctx *ctx); struct ttm_operation_ctx *ctx);
void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem); void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_resource *mem);
int ttm_bo_device_release(struct ttm_bo_device *bdev); int ttm_bo_device_release(struct ttm_bo_device *bdev);
...@@ -733,16 +733,16 @@ int ttm_resource_manager_force_list_clean(struct ttm_bo_device *bdev, ...@@ -733,16 +733,16 @@ int ttm_resource_manager_force_list_clean(struct ttm_bo_device *bdev,
*/ */
int ttm_mem_io_reserve(struct ttm_bo_device *bdev, int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
void ttm_mem_io_free(struct ttm_bo_device *bdev, void ttm_mem_io_free(struct ttm_bo_device *bdev,
struct ttm_mem_reg *mem); struct ttm_resource *mem);
/** /**
* ttm_bo_move_ttm * ttm_bo_move_ttm
* *
* @bo: A pointer to a struct ttm_buffer_object. * @bo: A pointer to a struct ttm_buffer_object.
* @interruptible: Sleep interruptible if waiting. * @interruptible: Sleep interruptible if waiting.
* @no_wait_gpu: Return immediately if the GPU is busy. * @no_wait_gpu: Return immediately if the GPU is busy.
* @new_mem: struct ttm_mem_reg indicating where to move. * @new_mem: struct ttm_resource indicating where to move.
* *
* Optimized move function for a buffer object with both old and * Optimized move function for a buffer object with both old and
* new placement backed by a TTM. The function will, if successful, * new placement backed by a TTM. The function will, if successful,
...@@ -756,7 +756,7 @@ void ttm_mem_io_free(struct ttm_bo_device *bdev, ...@@ -756,7 +756,7 @@ void ttm_mem_io_free(struct ttm_bo_device *bdev,
int ttm_bo_move_ttm(struct ttm_buffer_object *bo, int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem); struct ttm_resource *new_mem);
/** /**
* ttm_bo_move_memcpy * ttm_bo_move_memcpy
...@@ -764,7 +764,7 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo, ...@@ -764,7 +764,7 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
* @bo: A pointer to a struct ttm_buffer_object. * @bo: A pointer to a struct ttm_buffer_object.
* @interruptible: Sleep interruptible if waiting. * @interruptible: Sleep interruptible if waiting.
* @no_wait_gpu: Return immediately if the GPU is busy. * @no_wait_gpu: Return immediately if the GPU is busy.
* @new_mem: struct ttm_mem_reg indicating where to move. * @new_mem: struct ttm_resource indicating where to move.
* *
* Fallback move function for a mappable buffer object in mappable memory. * Fallback move function for a mappable buffer object in mappable memory.
* The function will, if successful, * The function will, if successful,
...@@ -778,7 +778,7 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo, ...@@ -778,7 +778,7 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
struct ttm_operation_ctx *ctx, struct ttm_operation_ctx *ctx,
struct ttm_mem_reg *new_mem); struct ttm_resource *new_mem);
/** /**
* ttm_bo_free_old_node * ttm_bo_free_old_node
...@@ -795,7 +795,7 @@ void ttm_bo_free_old_node(struct ttm_buffer_object *bo); ...@@ -795,7 +795,7 @@ void ttm_bo_free_old_node(struct ttm_buffer_object *bo);
* @bo: A pointer to a struct ttm_buffer_object. * @bo: A pointer to a struct ttm_buffer_object.
* @fence: A fence object that signals when moving is complete. * @fence: A fence object that signals when moving is complete.
* @evict: This is an evict move. Don't return until the buffer is idle. * @evict: This is an evict move. Don't return until the buffer is idle.
* @new_mem: struct ttm_mem_reg indicating where to move. * @new_mem: struct ttm_resource indicating where to move.
* *
* Accelerated move function to be called when an accelerated move * Accelerated move function to be called when an accelerated move
* has been scheduled. The function will create a new temporary buffer object * has been scheduled. The function will create a new temporary buffer object
...@@ -806,7 +806,7 @@ void ttm_bo_free_old_node(struct ttm_buffer_object *bo); ...@@ -806,7 +806,7 @@ void ttm_bo_free_old_node(struct ttm_buffer_object *bo);
*/ */
int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
struct dma_fence *fence, bool evict, struct dma_fence *fence, bool evict,
struct ttm_mem_reg *new_mem); struct ttm_resource *new_mem);
/** /**
* ttm_bo_pipeline_move. * ttm_bo_pipeline_move.
...@@ -814,14 +814,14 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, ...@@ -814,14 +814,14 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
* @bo: A pointer to a struct ttm_buffer_object. * @bo: A pointer to a struct ttm_buffer_object.
* @fence: A fence object that signals when moving is complete. * @fence: A fence object that signals when moving is complete.
* @evict: This is an evict move. Don't return until the buffer is idle. * @evict: This is an evict move. Don't return until the buffer is idle.
* @new_mem: struct ttm_mem_reg indicating where to move. * @new_mem: struct ttm_resource indicating where to move.
* *
* Function for pipelining accelerated moves. Either free the memory * Function for pipelining accelerated moves. Either free the memory
* immediately or hang it on a temporary buffer object. * immediately or hang it on a temporary buffer object.
*/ */
int ttm_bo_pipeline_move(struct ttm_buffer_object *bo, int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
struct dma_fence *fence, bool evict, struct dma_fence *fence, bool evict,
struct ttm_mem_reg *new_mem); struct ttm_resource *new_mem);
/** /**
* ttm_bo_pipeline_gutting. * ttm_bo_pipeline_gutting.
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <linux/types.h> #include <linux/types.h>
struct ttm_tt; struct ttm_tt;
struct ttm_mem_reg; struct ttm_resource;
struct ttm_buffer_object; struct ttm_buffer_object;
struct ttm_operation_ctx; struct ttm_operation_ctx;
...@@ -53,14 +53,14 @@ struct ttm_backend_func { ...@@ -53,14 +53,14 @@ struct ttm_backend_func {
* struct ttm_backend_func member bind * struct ttm_backend_func member bind
* *
* @ttm: Pointer to a struct ttm_tt. * @ttm: Pointer to a struct ttm_tt.
* @bo_mem: Pointer to a struct ttm_mem_reg describing the * @bo_mem: Pointer to a struct ttm_resource describing the
* memory type and location for binding. * memory type and location for binding.
* *
* Bind the backend pages into the aperture in the location * Bind the backend pages into the aperture in the location
* indicated by @bo_mem. This function should be able to handle * indicated by @bo_mem. This function should be able to handle
* differences between aperture and system page sizes. * differences between aperture and system page sizes.
*/ */
int (*bind) (struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem); int (*bind) (struct ttm_tt *ttm, struct ttm_resource *bo_mem);
/** /**
* struct ttm_backend_func member unbind * struct ttm_backend_func member unbind
...@@ -179,11 +179,11 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma); ...@@ -179,11 +179,11 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma);
* ttm_ttm_bind: * ttm_ttm_bind:
* *
* @ttm: The struct ttm_tt containing backing pages. * @ttm: The struct ttm_tt containing backing pages.
* @bo_mem: The struct ttm_mem_reg identifying the binding location. * @bo_mem: The struct ttm_resource identifying the binding location.
* *
* Bind the pages of @ttm to an aperture location identified by @bo_mem * Bind the pages of @ttm to an aperture location identified by @bo_mem
*/ */
int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem, int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem,
struct ttm_operation_ctx *ctx); struct ttm_operation_ctx *ctx);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment