Lines Matching refs:bo

42 void ttm_bo_free_old_node(struct ttm_buffer_object *bo)  in ttm_bo_free_old_node()  argument
44 ttm_bo_mem_put(bo, &bo->mem); in ttm_bo_free_old_node()
47 int ttm_bo_move_ttm(struct ttm_buffer_object *bo, in ttm_bo_move_ttm() argument
51 struct ttm_tt *ttm = bo->ttm; in ttm_bo_move_ttm()
52 struct ttm_mem_reg *old_mem = &bo->mem; in ttm_bo_move_ttm()
57 ttm_bo_free_old_node(bo); in ttm_bo_move_ttm()
104 struct ttm_buffer_object *bo; in ttm_mem_io_evict() local
109 bo = list_first_entry(&man->io_reserve_lru, in ttm_mem_io_evict()
112 list_del_init(&bo->io_reserve_lru); in ttm_mem_io_evict()
113 ttm_bo_unmap_virtual_locked(bo); in ttm_mem_io_evict()
160 int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo) in ttm_mem_io_reserve_vm() argument
162 struct ttm_mem_reg *mem = &bo->mem; in ttm_mem_io_reserve_vm()
167 &bo->bdev->man[mem->mem_type]; in ttm_mem_io_reserve_vm()
169 ret = ttm_mem_io_reserve(bo->bdev, mem); in ttm_mem_io_reserve_vm()
174 list_add_tail(&bo->io_reserve_lru, in ttm_mem_io_reserve_vm()
180 void ttm_mem_io_free_vm(struct ttm_buffer_object *bo) in ttm_mem_io_free_vm() argument
182 struct ttm_mem_reg *mem = &bo->mem; in ttm_mem_io_free_vm()
186 list_del_init(&bo->io_reserve_lru); in ttm_mem_io_free_vm()
187 ttm_mem_io_free(bo->bdev, mem); in ttm_mem_io_free_vm()
323 int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, in ttm_bo_move_memcpy() argument
327 struct ttm_bo_device *bdev = bo->bdev; in ttm_bo_move_memcpy()
329 struct ttm_tt *ttm = bo->ttm; in ttm_bo_move_memcpy()
330 struct ttm_mem_reg *old_mem = &bo->mem; in ttm_bo_move_memcpy()
407 bo->ttm = NULL; in ttm_bo_move_memcpy()
419 ttm_bo_mem_put(bo, &old_copy); in ttm_bo_move_memcpy()
424 static void ttm_transfered_destroy(struct ttm_buffer_object *bo) in ttm_transfered_destroy() argument
426 kfree(bo); in ttm_transfered_destroy()
444 static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, in ttm_buffer_object_transfer() argument
454 *fbo = *bo; in ttm_buffer_object_transfer()
506 static int ttm_bo_ioremap(struct ttm_buffer_object *bo, in ttm_bo_ioremap() argument
511 struct ttm_mem_reg *mem = &bo->mem; in ttm_bo_ioremap()
513 if (bo->mem.bus.addr) { in ttm_bo_ioremap()
515 map->virtual = (void *)(((u8 *)bo->mem.bus.addr) + offset); in ttm_bo_ioremap()
519 map->virtual = ioremap_wc(bo->mem.bus.base + bo->mem.bus.offset + offset, in ttm_bo_ioremap()
522 map->virtual = ioremap_nocache(bo->mem.bus.base + bo->mem.bus.offset + offset, in ttm_bo_ioremap()
528 static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo, in ttm_bo_kmap_ttm() argument
533 struct ttm_mem_reg *mem = &bo->mem; pgprot_t prot; in ttm_bo_kmap_ttm()
534 struct ttm_tt *ttm = bo->ttm; in ttm_bo_kmap_ttm()
567 int ttm_bo_kmap(struct ttm_buffer_object *bo, in ttm_bo_kmap() argument
572 &bo->bdev->man[bo->mem.mem_type]; in ttm_bo_kmap()
576 BUG_ON(!list_empty(&bo->swap)); in ttm_bo_kmap()
578 map->bo = bo; in ttm_bo_kmap()
579 if (num_pages > bo->num_pages) in ttm_bo_kmap()
581 if (start_page > bo->num_pages) in ttm_bo_kmap()
588 ret = ttm_mem_io_reserve(bo->bdev, &bo->mem); in ttm_bo_kmap()
592 if (!bo->mem.bus.is_iomem) { in ttm_bo_kmap()
593 return ttm_bo_kmap_ttm(bo, start_page, num_pages, map); in ttm_bo_kmap()
597 return ttm_bo_ioremap(bo, offset, size, map); in ttm_bo_kmap()
604 struct ttm_buffer_object *bo = map->bo; in ttm_bo_kunmap() local
606 &bo->bdev->man[bo->mem.mem_type]; in ttm_bo_kunmap()
626 ttm_mem_io_free(map->bo->bdev, &map->bo->mem); in ttm_bo_kunmap()
633 int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, in ttm_bo_move_accel_cleanup() argument
639 struct ttm_bo_device *bdev = bo->bdev; in ttm_bo_move_accel_cleanup()
641 struct ttm_mem_reg *old_mem = &bo->mem; in ttm_bo_move_accel_cleanup()
645 reservation_object_add_excl_fence(bo->resv, fence); in ttm_bo_move_accel_cleanup()
647 ret = ttm_bo_wait(bo, false, false, false); in ttm_bo_move_accel_cleanup()
652 (bo->ttm != NULL)) { in ttm_bo_move_accel_cleanup()
653 ttm_tt_unbind(bo->ttm); in ttm_bo_move_accel_cleanup()
654 ttm_tt_destroy(bo->ttm); in ttm_bo_move_accel_cleanup()
655 bo->ttm = NULL; in ttm_bo_move_accel_cleanup()
657 ttm_bo_free_old_node(bo); in ttm_bo_move_accel_cleanup()
667 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); in ttm_bo_move_accel_cleanup()
669 ret = ttm_buffer_object_transfer(bo, &ghost_obj); in ttm_bo_move_accel_cleanup()
684 bo->ttm = NULL; in ttm_bo_move_accel_cleanup()