mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-24 14:54:49 +08:00
drm/ttm: rename ttm_resource_manager_func callbacks
The names get/put are associated with reference counting in the Linux kernel, use alloc/free instead. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/384340/?series=80346&rev=1
This commit is contained in:
parent
13b0d4a9ae
commit
e92ae67d6e
@ -311,7 +311,7 @@ static void amdgpu_gtt_mgr_debug(struct ttm_resource_manager *man,
|
||||
}
|
||||
|
||||
static const struct ttm_resource_manager_func amdgpu_gtt_mgr_func = {
|
||||
.get_node = amdgpu_gtt_mgr_new,
|
||||
.put_node = amdgpu_gtt_mgr_del,
|
||||
.alloc = amdgpu_gtt_mgr_new,
|
||||
.free = amdgpu_gtt_mgr_del,
|
||||
.debug = amdgpu_gtt_mgr_debug
|
||||
};
|
||||
|
@ -606,7 +606,7 @@ static void amdgpu_vram_mgr_debug(struct ttm_resource_manager *man,
|
||||
}
|
||||
|
||||
static const struct ttm_resource_manager_func amdgpu_vram_mgr_func = {
|
||||
.get_node = amdgpu_vram_mgr_new,
|
||||
.put_node = amdgpu_vram_mgr_del,
|
||||
.debug = amdgpu_vram_mgr_debug
|
||||
.alloc = amdgpu_vram_mgr_new,
|
||||
.free = amdgpu_vram_mgr_del,
|
||||
.debug = amdgpu_vram_mgr_debug
|
||||
};
|
||||
|
@ -64,8 +64,8 @@ nouveau_vram_manager_new(struct ttm_resource_manager *man,
|
||||
}
|
||||
|
||||
const struct ttm_resource_manager_func nouveau_vram_manager = {
|
||||
.get_node = nouveau_vram_manager_new,
|
||||
.put_node = nouveau_manager_del,
|
||||
.alloc = nouveau_vram_manager_new,
|
||||
.free = nouveau_manager_del,
|
||||
};
|
||||
|
||||
static int
|
||||
@ -87,8 +87,8 @@ nouveau_gart_manager_new(struct ttm_resource_manager *man,
|
||||
}
|
||||
|
||||
const struct ttm_resource_manager_func nouveau_gart_manager = {
|
||||
.get_node = nouveau_gart_manager_new,
|
||||
.put_node = nouveau_manager_del,
|
||||
.alloc = nouveau_gart_manager_new,
|
||||
.free = nouveau_manager_del,
|
||||
};
|
||||
|
||||
static int
|
||||
@ -119,8 +119,8 @@ nv04_gart_manager_new(struct ttm_resource_manager *man,
|
||||
}
|
||||
|
||||
const struct ttm_resource_manager_func nv04_gart_manager = {
|
||||
.get_node = nv04_gart_manager_new,
|
||||
.put_node = nouveau_manager_del,
|
||||
.alloc = nv04_gart_manager_new,
|
||||
.free = nouveau_manager_del,
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -846,20 +846,20 @@ static int ttm_bo_mem_get(struct ttm_buffer_object *bo,
|
||||
struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, mem->mem_type);
|
||||
|
||||
mem->mm_node = NULL;
|
||||
if (!man->func || !man->func->get_node)
|
||||
if (!man->func || !man->func->alloc)
|
||||
return 0;
|
||||
|
||||
return man->func->get_node(man, bo, place, mem);
|
||||
return man->func->alloc(man, bo, place, 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);
|
||||
|
||||
if (!man->func || !man->func->put_node)
|
||||
if (!man->func || !man->func->free)
|
||||
return;
|
||||
|
||||
man->func->put_node(man, mem);
|
||||
man->func->free(man, mem);
|
||||
mem->mm_node = NULL;
|
||||
mem->mem_type = TTM_PL_SYSTEM;
|
||||
}
|
||||
|
@ -54,10 +54,10 @@ static inline struct ttm_range_manager *to_range_manager(struct ttm_resource_man
|
||||
return container_of(man, struct ttm_range_manager, manager);
|
||||
}
|
||||
|
||||
static int ttm_range_man_get_node(struct ttm_resource_manager *man,
|
||||
struct ttm_buffer_object *bo,
|
||||
const struct ttm_place *place,
|
||||
struct ttm_resource *mem)
|
||||
static int ttm_range_man_alloc(struct ttm_resource_manager *man,
|
||||
struct ttm_buffer_object *bo,
|
||||
const struct ttm_place *place,
|
||||
struct ttm_resource *mem)
|
||||
{
|
||||
struct ttm_range_manager *rman = to_range_manager(man);
|
||||
struct drm_mm *mm = &rman->mm;
|
||||
@ -95,8 +95,8 @@ static int ttm_range_man_get_node(struct ttm_resource_manager *man,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ttm_range_man_put_node(struct ttm_resource_manager *man,
|
||||
struct ttm_resource *mem)
|
||||
static void ttm_range_man_free(struct ttm_resource_manager *man,
|
||||
struct ttm_resource *mem)
|
||||
{
|
||||
struct ttm_range_manager *rman = to_range_manager(man);
|
||||
|
||||
@ -181,7 +181,7 @@ static void ttm_range_man_debug(struct ttm_resource_manager *man,
|
||||
}
|
||||
|
||||
static const struct ttm_resource_manager_func ttm_range_manager_func = {
|
||||
.get_node = ttm_range_man_get_node,
|
||||
.put_node = ttm_range_man_put_node,
|
||||
.alloc = ttm_range_man_alloc,
|
||||
.free = ttm_range_man_free,
|
||||
.debug = ttm_range_man_debug
|
||||
};
|
||||
|
@ -156,6 +156,6 @@ void vmw_gmrid_man_fini(struct vmw_private *dev_priv, int type)
|
||||
}
|
||||
|
||||
static const struct ttm_resource_manager_func vmw_gmrid_manager_func = {
|
||||
.get_node = vmw_gmrid_man_get_node,
|
||||
.put_node = vmw_gmrid_man_put_node,
|
||||
.alloc = vmw_gmrid_man_get_node,
|
||||
.free = vmw_gmrid_man_put_node,
|
||||
};
|
||||
|
@ -177,7 +177,7 @@ static void vmw_thp_debug(struct ttm_resource_manager *man,
|
||||
}
|
||||
|
||||
const struct ttm_resource_manager_func vmw_thp_func = {
|
||||
.get_node = vmw_thp_get_node,
|
||||
.put_node = vmw_thp_put_node,
|
||||
.alloc = vmw_thp_get_node,
|
||||
.free = vmw_thp_put_node,
|
||||
.debug = vmw_thp_debug
|
||||
};
|
||||
|
@ -49,7 +49,7 @@ struct ttm_resource_manager;
|
||||
|
||||
struct ttm_resource_manager_func {
|
||||
/**
|
||||
* struct ttm_resource_manager member get_node
|
||||
* struct ttm_resource_manager_func member alloc
|
||||
*
|
||||
* @man: Pointer to a memory type manager.
|
||||
* @bo: Pointer to the buffer object we're allocating space for.
|
||||
@ -76,13 +76,13 @@ struct ttm_resource_manager_func {
|
||||
* an implementation can and must use either a mutex or a spinlock to
|
||||
* protect any data structures managing the space.
|
||||
*/
|
||||
int (*get_node)(struct ttm_resource_manager *man,
|
||||
struct ttm_buffer_object *bo,
|
||||
const struct ttm_place *place,
|
||||
struct ttm_resource *mem);
|
||||
int (*alloc)(struct ttm_resource_manager *man,
|
||||
struct ttm_buffer_object *bo,
|
||||
const struct ttm_place *place,
|
||||
struct ttm_resource *mem);
|
||||
|
||||
/**
|
||||
* struct ttm_resource_manager member put_node
|
||||
* struct ttm_resource_manager_func member free
|
||||
*
|
||||
* @man: Pointer to a memory type manager.
|
||||
* @mem: Pointer to a struct ttm_resource to be filled in.
|
||||
@ -91,11 +91,11 @@ struct ttm_resource_manager_func {
|
||||
* and that are identified by @mem::mm_node and @mem::start. May not
|
||||
* be called from within atomic context.
|
||||
*/
|
||||
void (*put_node)(struct ttm_resource_manager *man,
|
||||
struct ttm_resource *mem);
|
||||
void (*free)(struct ttm_resource_manager *man,
|
||||
struct ttm_resource *mem);
|
||||
|
||||
/**
|
||||
* struct ttm_resource_manager member debug
|
||||
* struct ttm_resource_manager_func member debug
|
||||
*
|
||||
* @man: Pointer to a memory type manager.
|
||||
* @printer: Prefix to be used in printout to identify the caller.
|
||||
|
Loading…
Reference in New Issue
Block a user