diff options
author | Dave Airlie <airlied@redhat.com> | 2020-08-04 05:56:28 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-08-06 06:12:40 +0300 |
commit | 90a0489a718b87bc0674792f9eafac007e0ea3d6 (patch) | |
tree | a4ae53e808b1b49c329b9d8f7ec1b55223df74db /drivers/gpu/drm/ttm | |
parent | a751612d4cb77779669da0a6d19fbc4f7e72ba6f (diff) | |
download | linux-90a0489a718b87bc0674792f9eafac007e0ea3d6.tar.xz |
drm/ttm: drop type manager has_type
under driver control, this flag isn't needed anymore,
remove the API that used to access it, and consoldiate
with the used api.
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-56-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo_manager.c | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 6f02c7fa180a..c1644a0e0586 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -80,7 +80,6 @@ static inline int ttm_mem_type_from_place(const struct ttm_place *place, void ttm_mem_type_manager_debug(struct ttm_mem_type_manager *man, struct drm_printer *p) { - drm_printf(p, " has_type: %d\n", man->has_type); drm_printf(p, " use_type: %d\n", man->use_type); drm_printf(p, " use_tt: %d\n", man->use_tt); drm_printf(p, " size: %llu\n", man->size); @@ -1001,7 +1000,7 @@ static int ttm_bo_mem_placement(struct ttm_buffer_object *bo, return ret; man = ttm_manager_type(bdev, mem_type); - if (!man->has_type || !man->use_type) + if (!man || !man->use_type) return -EBUSY; if (!ttm_bo_mt_compatible(man, mem_type, place, &cur_flags)) @@ -1460,7 +1459,7 @@ int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type) return -EINVAL; } - if (!man->has_type) { + if (!man) { pr_err("Memory type %u has not been initialized\n", mem_type); return 0; } @@ -1474,7 +1473,6 @@ void ttm_mem_type_manager_init(struct ttm_mem_type_manager *man, { unsigned i; - BUG_ON(man->has_type); man->use_io_reserve_lru = false; mutex_init(&man->io_reserve_mutex); spin_lock_init(&man->move_lock); @@ -1555,7 +1553,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev) struct ttm_mem_type_manager *man; man = ttm_manager_type(bdev, TTM_PL_SYSTEM); - ttm_mem_type_manager_disable(man); + ttm_mem_type_manager_set_used(man, false); ttm_set_driver_manager(bdev, TTM_PL_SYSTEM, NULL); mutex_lock(&ttm_global_mutex); diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c index 1b7245ce3356..6679dc11934f 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c @@ -152,7 +152,7 @@ int ttm_range_man_fini(struct ttm_bo_device *bdev, struct drm_mm *mm = &rman->mm; int ret; - ttm_mem_type_manager_disable(man); + ttm_mem_type_manager_set_used(man, false); ret = ttm_mem_type_manager_force_list_clean(bdev, man); if (ret) |