Lines Matching refs:bdev
61 man = ttm_manager_type(bo->bdev, mem_type); in ttm_bo_mem_space_debug()
105 spin_lock(&bo->bdev->lru_lock); in ttm_bo_set_bulk_move()
111 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_set_bulk_move()
120 struct ttm_device *bdev = bo->bdev; in ttm_bo_handle_move_mem() local
125 ttm_manager_type(bdev, bo->resource->mem_type)->use_tt; in ttm_bo_handle_move_mem()
126 new_use_tt = ttm_manager_type(bdev, mem->mem_type)->use_tt; in ttm_bo_handle_move_mem()
143 ret = ttm_tt_populate(bo->bdev, bo->ttm, ctx); in ttm_bo_handle_move_mem()
153 ret = bdev->funcs->move(bo, evict, ctx, mem, hop); in ttm_bo_handle_move_mem()
180 if (bo->bdev->funcs->delete_mem_notify) in ttm_bo_cleanup_memtype_use()
181 bo->bdev->funcs->delete_mem_notify(bo); in ttm_bo_cleanup_memtype_use()
206 spin_lock(&bo->bdev->lru_lock); in ttm_bo_individualize_resv()
208 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_individualize_resv()
259 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_cleanup_refs()
270 spin_lock(&bo->bdev->lru_lock); in ttm_bo_cleanup_refs()
280 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_cleanup_refs()
289 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_cleanup_refs()
294 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_cleanup_refs()
309 bool ttm_bo_delayed_delete(struct ttm_device *bdev, bool remove_all) in ttm_bo_delayed_delete() argument
316 spin_lock(&bdev->lru_lock); in ttm_bo_delayed_delete()
317 while (!list_empty(&bdev->ddestroy)) { in ttm_bo_delayed_delete()
320 bo = list_first_entry(&bdev->ddestroy, struct ttm_buffer_object, in ttm_bo_delayed_delete()
327 spin_unlock(&bdev->lru_lock); in ttm_bo_delayed_delete()
330 spin_lock(&bdev->lru_lock); in ttm_bo_delayed_delete()
336 spin_unlock(&bdev->lru_lock); in ttm_bo_delayed_delete()
340 spin_lock(&bdev->lru_lock); in ttm_bo_delayed_delete()
342 list_splice_tail(&removed, &bdev->ddestroy); in ttm_bo_delayed_delete()
343 empty = list_empty(&bdev->ddestroy); in ttm_bo_delayed_delete()
344 spin_unlock(&bdev->lru_lock); in ttm_bo_delayed_delete()
353 struct ttm_device *bdev = bo->bdev; in ttm_bo_release() local
370 if (bo->bdev->funcs->release_notify) in ttm_bo_release()
371 bo->bdev->funcs->release_notify(bo); in ttm_bo_release()
373 drm_vma_offset_remove(bdev->vma_manager, &bo->base.vma_node); in ttm_bo_release()
374 ttm_mem_io_free(bdev, bo->resource); in ttm_bo_release()
383 spin_lock(&bo->bdev->lru_lock); in ttm_bo_release()
399 list_add_tail(&bo->ddestroy, &bdev->ddestroy); in ttm_bo_release()
400 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_release()
402 schedule_delayed_work(&bdev->wq, in ttm_bo_release()
407 spin_lock(&bo->bdev->lru_lock); in ttm_bo_release()
409 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_release()
424 int ttm_bo_lock_delayed_workqueue(struct ttm_device *bdev) in ttm_bo_lock_delayed_workqueue() argument
426 return cancel_delayed_work_sync(&bdev->wq); in ttm_bo_lock_delayed_workqueue()
430 void ttm_bo_unlock_delayed_workqueue(struct ttm_device *bdev, int resched) in ttm_bo_unlock_delayed_workqueue() argument
433 schedule_delayed_work(&bdev->wq, in ttm_bo_unlock_delayed_workqueue()
466 struct ttm_device *bdev = bo->bdev; in ttm_bo_evict() local
478 bdev->funcs->evict_flags(bo, &placement); in ttm_bo_evict()
522 struct ttm_device *bdev = bo->bdev; in ttm_bo_eviction_valuable() local
531 return ttm_resource_intersects(bdev, res, place, bo->base.size); in ttm_bo_eviction_valuable()
567 !bo->bdev->funcs->eviction_valuable(bo, place))) { in ttm_bo_evict_swapout_allowable()
613 int ttm_mem_evict_first(struct ttm_device *bdev, in ttm_mem_evict_first() argument
625 spin_lock(&bdev->lru_lock); in ttm_mem_evict_first()
648 spin_unlock(&bdev->lru_lock); in ttm_mem_evict_first()
662 spin_unlock(&bdev->lru_lock); in ttm_mem_evict_first()
685 spin_lock(&bo->bdev->lru_lock); in ttm_bo_pin()
689 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_pin()
706 spin_lock(&bo->bdev->lru_lock); in ttm_bo_unpin()
710 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_unpin()
755 struct ttm_device *bdev = bo->bdev; in ttm_bo_mem_force_space() local
760 man = ttm_manager_type(bdev, place->mem_type); in ttm_bo_mem_force_space()
768 ret = ttm_mem_evict_first(bdev, man, place, ctx, in ttm_bo_mem_force_space()
790 struct ttm_device *bdev = bo->bdev; in ttm_bo_mem_space() local
802 man = ttm_manager_type(bdev, place->mem_type); in ttm_bo_mem_space()
828 man = ttm_manager_type(bdev, place->mem_type); in ttm_bo_mem_space()
956 int ttm_bo_init_reserved(struct ttm_device *bdev, struct ttm_buffer_object *bo, in ttm_bo_init_reserved() argument
967 bo->bdev = bdev; in ttm_bo_init_reserved()
991 ret = drm_vma_offset_add(bdev->vma_manager, &bo->base.vma_node, in ttm_bo_init_reserved()
1057 int ttm_bo_init_validate(struct ttm_device *bdev, struct ttm_buffer_object *bo, in ttm_bo_init_validate() argument
1066 ret = ttm_bo_init_reserved(bdev, bo, type, placement, alignment, &ctx, in ttm_bo_init_validate()
1084 struct ttm_device *bdev = bo->bdev; in ttm_bo_unmap_virtual() local
1086 drm_vma_node_unmap(&bo->base.vma_node, bdev->dev_mapping); in ttm_bo_unmap_virtual()
1087 ttm_mem_io_free(bdev, bo->resource); in ttm_bo_unmap_virtual()
1149 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_swapout()
1185 if (bo->bdev->funcs->swap_notify) in ttm_bo_swapout()
1186 bo->bdev->funcs->swap_notify(bo); in ttm_bo_swapout()
1189 ret = ttm_tt_swapout(bo->bdev, bo->ttm, gfp_flags); in ttm_bo_swapout()
1207 ttm_tt_unpopulate(bo->bdev, bo->ttm); in ttm_bo_tt_destroy()
1208 ttm_tt_destroy(bo->bdev, bo->ttm); in ttm_bo_tt_destroy()