Lines Matching refs:bdev

126 	struct ttm_device *bdev;  in ttm_global_swapout()  local
130 list_for_each_entry(bdev, &glob->device_list, device_list) { in ttm_global_swapout()
131 ret = ttm_device_swapout(bdev, ctx, gfp_flags); in ttm_global_swapout()
133 list_move_tail(&bdev->device_list, &glob->device_list); in ttm_global_swapout()
141 int ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx, in ttm_device_swapout() argument
150 spin_lock(&bdev->lru_lock); in ttm_device_swapout()
152 man = ttm_manager_type(bdev, i); in ttm_device_swapout()
172 spin_unlock(&bdev->lru_lock); in ttm_device_swapout()
192 int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs, in ttm_device_init() argument
207 bdev->wq = alloc_workqueue("ttm", WQ_MEM_RECLAIM | WQ_HIGHPRI, 16); in ttm_device_init()
208 if (!bdev->wq) { in ttm_device_init()
213 bdev->funcs = funcs; in ttm_device_init()
215 ttm_sys_man_init(bdev); in ttm_device_init()
216 ttm_pool_init(&bdev->pool, dev, NUMA_NO_NODE, use_dma_alloc, use_dma32); in ttm_device_init()
218 bdev->vma_manager = vma_manager; in ttm_device_init()
219 spin_lock_init(&bdev->lru_lock); in ttm_device_init()
220 INIT_LIST_HEAD(&bdev->pinned); in ttm_device_init()
221 bdev->dev_mapping = mapping; in ttm_device_init()
223 list_add_tail(&bdev->device_list, &glob->device_list); in ttm_device_init()
230 void ttm_device_fini(struct ttm_device *bdev) in ttm_device_fini() argument
236 list_del(&bdev->device_list); in ttm_device_fini()
239 drain_workqueue(bdev->wq); in ttm_device_fini()
240 destroy_workqueue(bdev->wq); in ttm_device_fini()
242 man = ttm_manager_type(bdev, TTM_PL_SYSTEM); in ttm_device_fini()
244 ttm_set_driver_manager(bdev, TTM_PL_SYSTEM, NULL); in ttm_device_fini()
246 spin_lock(&bdev->lru_lock); in ttm_device_fini()
250 spin_unlock(&bdev->lru_lock); in ttm_device_fini()
252 ttm_pool_fini(&bdev->pool); in ttm_device_fini()
257 static void ttm_device_clear_lru_dma_mappings(struct ttm_device *bdev, in ttm_device_clear_lru_dma_mappings() argument
262 spin_lock(&bdev->lru_lock); in ttm_device_clear_lru_dma_mappings()
271 spin_unlock(&bdev->lru_lock); in ttm_device_clear_lru_dma_mappings()
274 ttm_tt_unpopulate(bo->bdev, bo->ttm); in ttm_device_clear_lru_dma_mappings()
277 spin_lock(&bdev->lru_lock); in ttm_device_clear_lru_dma_mappings()
279 spin_unlock(&bdev->lru_lock); in ttm_device_clear_lru_dma_mappings()
282 void ttm_device_clear_dma_mappings(struct ttm_device *bdev) in ttm_device_clear_dma_mappings() argument
287 ttm_device_clear_lru_dma_mappings(bdev, &bdev->pinned); in ttm_device_clear_dma_mappings()
290 man = ttm_manager_type(bdev, i); in ttm_device_clear_dma_mappings()
295 ttm_device_clear_lru_dma_mappings(bdev, &man->lru[j]); in ttm_device_clear_dma_mappings()