mirror of
https://github.com/torvalds/linux.git
synced 2026-04-27 19:12:29 -04:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user