drm/ttm: rename bo->mem and make it a pointer

When we want to decouble resource management from buffer management we need to
be able to handle resources separately.

Add a resource pointer and rename bo->mem so that all code needs to
change to access the pointer instead.

No functional change.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210430092508.60710-4-christian.koenig@amd.com
This commit is contained in:
Christian König
2021-04-12 15:11:47 +02:00
parent 9450129ed9
commit d3116756a7
49 changed files with 274 additions and 265 deletions

View File

@@ -719,7 +719,7 @@ static int vmw_move(struct ttm_buffer_object *bo,
struct ttm_resource *new_mem,
struct ttm_place *hop)
{
struct ttm_resource_manager *old_man = ttm_manager_type(bo->bdev, bo->mem.mem_type);
struct ttm_resource_manager *old_man = ttm_manager_type(bo->bdev, bo->resource->mem_type);
struct ttm_resource_manager *new_man = ttm_manager_type(bo->bdev, new_mem->mem_type);
int ret;
@@ -729,10 +729,10 @@ static int vmw_move(struct ttm_buffer_object *bo,
return ret;
}
vmw_move_notify(bo, &bo->mem, new_mem);
vmw_move_notify(bo, bo->resource, new_mem);
if (old_man->use_tt && new_man->use_tt) {
if (bo->mem.mem_type == TTM_PL_SYSTEM) {
if (bo->resource->mem_type == TTM_PL_SYSTEM) {
ttm_bo_assign_mem(bo, new_mem);
return 0;
}
@@ -741,7 +741,7 @@ static int vmw_move(struct ttm_buffer_object *bo,
goto fail;
vmw_ttm_unbind(bo->bdev, bo->ttm);
ttm_resource_free(bo, &bo->mem);
ttm_resource_free(bo, bo->resource);
ttm_bo_assign_mem(bo, new_mem);
return 0;
} else {
@@ -751,7 +751,7 @@ static int vmw_move(struct ttm_buffer_object *bo,
}
return 0;
fail:
vmw_move_notify(bo, new_mem, &bo->mem);
vmw_move_notify(bo, new_mem, bo->resource);
return ret;
}