mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 01:51:34 +00:00
drm/ttm: remove range manager legacy takedown path
Now all drivers have been converted, drop the non-driver path. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-35-airlied@gmail.com
This commit is contained in:
parent
6eee6675e0
commit
085097e5ae
@ -129,26 +129,11 @@ int ttm_range_man_init(struct ttm_bo_device *bdev,
|
||||
}
|
||||
EXPORT_SYMBOL(ttm_range_man_init);
|
||||
|
||||
static int ttm_bo_man_takedown_private(struct ttm_mem_type_manager *man)
|
||||
{
|
||||
struct ttm_range_manager *rman = (struct ttm_range_manager *) man->priv;
|
||||
struct drm_mm *mm = &rman->mm;
|
||||
|
||||
spin_lock(&rman->lock);
|
||||
if (drm_mm_clean(mm)) {
|
||||
drm_mm_takedown(mm);
|
||||
spin_unlock(&rman->lock);
|
||||
kfree(rman);
|
||||
man->priv = NULL;
|
||||
return 0;
|
||||
}
|
||||
spin_unlock(&rman->lock);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
int ttm_range_man_fini(struct ttm_bo_device *bdev,
|
||||
struct ttm_mem_type_manager *man)
|
||||
{
|
||||
struct ttm_range_manager *rman = (struct ttm_range_manager *) man->priv;
|
||||
struct drm_mm *mm = &rman->mm;
|
||||
int ret;
|
||||
|
||||
ttm_mem_type_manager_disable(man);
|
||||
@ -157,7 +142,13 @@ int ttm_range_man_fini(struct ttm_bo_device *bdev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ttm_bo_man_takedown_private(man);
|
||||
spin_lock(&rman->lock);
|
||||
drm_mm_clean(mm);
|
||||
drm_mm_takedown(mm);
|
||||
spin_unlock(&rman->lock);
|
||||
kfree(rman);
|
||||
man->priv = NULL;
|
||||
|
||||
ttm_mem_type_manager_cleanup(man);
|
||||
return 0;
|
||||
}
|
||||
@ -174,7 +165,6 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
|
||||
}
|
||||
|
||||
static const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
|
||||
.takedown = ttm_bo_man_takedown_private,
|
||||
.get_node = ttm_bo_man_get_node,
|
||||
.put_node = ttm_bo_man_put_node,
|
||||
.debug = ttm_bo_man_debug
|
||||
|
Loading…
Reference in New Issue
Block a user