Lines Matching refs:tbo

64 	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);  in amdgpu_bo_subtract_pin_size()
66 if (bo->tbo.mem.mem_type == TTM_PL_VRAM) { in amdgpu_bo_subtract_pin_size()
70 } else if (bo->tbo.mem.mem_type == TTM_PL_TT) { in amdgpu_bo_subtract_pin_size()
75 static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo) in amdgpu_bo_destroy() argument
77 struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev); in amdgpu_bo_destroy()
78 struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo); in amdgpu_bo_destroy()
85 if (bo->tbo.base.import_attach) in amdgpu_bo_destroy()
86 drm_prime_gem_destroy(&bo->tbo.base, bo->tbo.sg); in amdgpu_bo_destroy()
87 drm_gem_object_release(&bo->tbo.base); in amdgpu_bo_destroy()
127 struct amdgpu_device *adev = amdgpu_ttm_adev(abo->tbo.bdev); in amdgpu_bo_placement_from_domain()
277 r = amdgpu_ttm_alloc_gart(&(*bo_ptr)->tbo); in amdgpu_bo_create_reserved()
490 drm_gem_private_object_init(adev->ddev, &bo->tbo.base, size); in amdgpu_bo_do_create()
505 bo->tbo.bdev = &adev->mman.bdev; in amdgpu_bo_do_create()
512 bo->tbo.priority = 1; in amdgpu_bo_do_create()
514 r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, bp->type, in amdgpu_bo_do_create()
521 bo->tbo.mem.mem_type == TTM_PL_VRAM && in amdgpu_bo_do_create()
522 bo->tbo.mem.start < adev->gmc.visible_vram_size >> PAGE_SHIFT) in amdgpu_bo_do_create()
529 bo->tbo.mem.placement & TTM_PL_FLAG_VRAM) { in amdgpu_bo_do_create()
532 r = amdgpu_fill_buffer(bo, 0, bo->tbo.base.resv, &fence); in amdgpu_bo_do_create()
537 dma_fence_put(bo->tbo.moving); in amdgpu_bo_do_create()
538 bo->tbo.moving = dma_fence_get(fence); in amdgpu_bo_do_create()
555 dma_resv_unlock(bo->tbo.base.resv); in amdgpu_bo_do_create()
576 bp.resv = bo->tbo.base.resv; in amdgpu_bo_create_shadow()
617 WARN_ON(dma_resv_lock((*bo_ptr)->tbo.base.resv, in amdgpu_bo_create()
623 dma_resv_unlock((*bo_ptr)->tbo.base.resv); in amdgpu_bo_create()
657 r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); in amdgpu_bo_validate()
682 struct amdgpu_device *adev = amdgpu_ttm_adev(shadow->tbo.bdev); in amdgpu_bo_restore_shadow()
720 r = dma_resv_wait_timeout_rcu(bo->tbo.base.resv, false, false, in amdgpu_bo_kmap()
725 r = ttm_bo_kmap(&bo->tbo, 0, bo->tbo.num_pages, &bo->kmap); in amdgpu_bo_kmap()
777 ttm_bo_get(&bo->tbo); in amdgpu_bo_ref()
789 struct ttm_buffer_object *tbo; in amdgpu_bo_unref() local
794 tbo = &((*bo)->tbo); in amdgpu_bo_unref()
795 ttm_bo_put(tbo); in amdgpu_bo_unref()
824 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_pin_restricted()
828 if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm)) in amdgpu_bo_pin_restricted()
848 uint32_t mem_type = bo->tbo.mem.mem_type; in amdgpu_bo_pin_restricted()
856 u64 domain_start = bo->tbo.bdev->man[mem_type].gpu_offset; in amdgpu_bo_pin_restricted()
883 r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); in amdgpu_bo_pin_restricted()
891 domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type); in amdgpu_bo_pin_restricted()
933 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_unpin()
951 r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); in amdgpu_bo_unpin()
1062 return ttm_fbdev_mmap(vma, &bo->tbo); in amdgpu_bo_fbdev_mmap()
1078 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_set_tiling_flags()
1098 dma_resv_assert_held(bo->tbo.base.resv); in amdgpu_bo_get_tiling_flags()
1330 struct dma_resv *resv = bo->tbo.base.resv; in amdgpu_bo_fence()
1350 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_sync_wait()
1355 amdgpu_sync_resv(adev, &sync, bo->tbo.base.resv, owner, false); in amdgpu_bo_sync_wait()
1374 WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_SYSTEM); in amdgpu_bo_gpu_offset()
1375 WARN_ON_ONCE(!dma_resv_is_locked(bo->tbo.base.resv) && in amdgpu_bo_gpu_offset()
1376 !bo->pin_count && bo->tbo.type != ttm_bo_type_kernel); in amdgpu_bo_gpu_offset()
1377 WARN_ON_ONCE(bo->tbo.mem.start == AMDGPU_BO_INVALID_OFFSET); in amdgpu_bo_gpu_offset()
1378 WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_VRAM && in amdgpu_bo_gpu_offset()
1381 return amdgpu_gmc_sign_extend(bo->tbo.offset); in amdgpu_bo_gpu_offset()