Loading drivers/gpu/drm/ttm/ttm_bo.c +6 −26 Original line number Diff line number Diff line Loading @@ -434,36 +434,25 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, } /** * Call bo::reserved and with the lru lock held. * Call bo::reserved. * Will release GPU memory type usage on destruction. * This is the place to put in driver specific hooks. * Will release the bo::reserved lock and the * lru lock on exit. * This is the place to put in driver specific hooks to release * driver private resources. * Will release the bo::reserved lock. */ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo) { struct ttm_bo_global *glob = bo->glob; if (bo->ttm) { /** * Release the lru_lock, since we don't want to have * an atomic requirement on ttm_tt[unbind|destroy]. */ spin_unlock(&glob->lru_lock); ttm_tt_unbind(bo->ttm); ttm_tt_destroy(bo->ttm); bo->ttm = NULL; spin_lock(&glob->lru_lock); } ttm_bo_mem_put_locked(bo, &bo->mem); ttm_bo_mem_put(bo, &bo->mem); atomic_set(&bo->reserved, 0); wake_up_all(&bo->event_queue); spin_unlock(&glob->lru_lock); } Loading Loading @@ -528,7 +517,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, bool remove_all) list_del_init(&bo->ddestroy); ++put_count; } spin_unlock(&glob->lru_lock); ttm_bo_cleanup_memtype_use(bo); while (put_count--) Loading Loading @@ -784,15 +773,6 @@ void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem) } EXPORT_SYMBOL(ttm_bo_mem_put); void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem) { struct ttm_mem_type_manager *man = &bo->bdev->man[mem->mem_type]; if (mem->mm_node) (*man->func->put_node_locked)(man, mem); } EXPORT_SYMBOL(ttm_bo_mem_put_locked); /** * Repeatedly evict memory from the LRU for @mem_type until we create enough * space, or we've evicted everything and there isn't enough space. Loading drivers/gpu/drm/ttm/ttm_bo_manager.c +0 −10 Original line number Diff line number Diff line Loading @@ -90,15 +90,6 @@ static void ttm_bo_man_put_node(struct ttm_mem_type_manager *man, } } static void ttm_bo_man_put_node_locked(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) { if (mem->mm_node) { drm_mm_put_block(mem->mm_node); mem->mm_node = NULL; } } static int ttm_bo_man_init(struct ttm_mem_type_manager *man, unsigned long p_size) { Loading Loading @@ -152,7 +143,6 @@ const struct ttm_mem_type_manager_func ttm_bo_manager_func = { ttm_bo_man_takedown, ttm_bo_man_get_node, ttm_bo_man_put_node, ttm_bo_man_put_node_locked, ttm_bo_man_debug }; EXPORT_SYMBOL(ttm_bo_manager_func); include/drm/ttm/ttm_bo_driver.h +0 −2 Original line number Diff line number Diff line Loading @@ -214,8 +214,6 @@ struct ttm_mem_type_manager_func { struct ttm_mem_reg *mem); void (*put_node)(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem); void (*put_node_locked)(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem); void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); }; Loading Loading
drivers/gpu/drm/ttm/ttm_bo.c +6 −26 Original line number Diff line number Diff line Loading @@ -434,36 +434,25 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, } /** * Call bo::reserved and with the lru lock held. * Call bo::reserved. * Will release GPU memory type usage on destruction. * This is the place to put in driver specific hooks. * Will release the bo::reserved lock and the * lru lock on exit. * This is the place to put in driver specific hooks to release * driver private resources. * Will release the bo::reserved lock. */ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo) { struct ttm_bo_global *glob = bo->glob; if (bo->ttm) { /** * Release the lru_lock, since we don't want to have * an atomic requirement on ttm_tt[unbind|destroy]. */ spin_unlock(&glob->lru_lock); ttm_tt_unbind(bo->ttm); ttm_tt_destroy(bo->ttm); bo->ttm = NULL; spin_lock(&glob->lru_lock); } ttm_bo_mem_put_locked(bo, &bo->mem); ttm_bo_mem_put(bo, &bo->mem); atomic_set(&bo->reserved, 0); wake_up_all(&bo->event_queue); spin_unlock(&glob->lru_lock); } Loading Loading @@ -528,7 +517,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, bool remove_all) list_del_init(&bo->ddestroy); ++put_count; } spin_unlock(&glob->lru_lock); ttm_bo_cleanup_memtype_use(bo); while (put_count--) Loading Loading @@ -784,15 +773,6 @@ void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem) } EXPORT_SYMBOL(ttm_bo_mem_put); void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem) { struct ttm_mem_type_manager *man = &bo->bdev->man[mem->mem_type]; if (mem->mm_node) (*man->func->put_node_locked)(man, mem); } EXPORT_SYMBOL(ttm_bo_mem_put_locked); /** * Repeatedly evict memory from the LRU for @mem_type until we create enough * space, or we've evicted everything and there isn't enough space. Loading
drivers/gpu/drm/ttm/ttm_bo_manager.c +0 −10 Original line number Diff line number Diff line Loading @@ -90,15 +90,6 @@ static void ttm_bo_man_put_node(struct ttm_mem_type_manager *man, } } static void ttm_bo_man_put_node_locked(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) { if (mem->mm_node) { drm_mm_put_block(mem->mm_node); mem->mm_node = NULL; } } static int ttm_bo_man_init(struct ttm_mem_type_manager *man, unsigned long p_size) { Loading Loading @@ -152,7 +143,6 @@ const struct ttm_mem_type_manager_func ttm_bo_manager_func = { ttm_bo_man_takedown, ttm_bo_man_get_node, ttm_bo_man_put_node, ttm_bo_man_put_node_locked, ttm_bo_man_debug }; EXPORT_SYMBOL(ttm_bo_manager_func);
include/drm/ttm/ttm_bo_driver.h +0 −2 Original line number Diff line number Diff line Loading @@ -214,8 +214,6 @@ struct ttm_mem_type_manager_func { struct ttm_mem_reg *mem); void (*put_node)(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem); void (*put_node_locked)(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem); void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); }; Loading