Lines Matching refs:tbo

65 	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);  in amdgpu_bo_subtract_pin_size()
67 if (bo->tbo.mem.mem_type == TTM_PL_VRAM) { in amdgpu_bo_subtract_pin_size()
71 } else if (bo->tbo.mem.mem_type == TTM_PL_TT) { in amdgpu_bo_subtract_pin_size()
76 static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo) in amdgpu_bo_destroy() argument
78 struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev); in amdgpu_bo_destroy()
79 struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo); in amdgpu_bo_destroy()
86 if (bo->tbo.base.import_attach) in amdgpu_bo_destroy()
87 drm_prime_gem_destroy(&bo->tbo.base, bo->tbo.sg); in amdgpu_bo_destroy()
88 drm_gem_object_release(&bo->tbo.base); in amdgpu_bo_destroy()
128 struct amdgpu_device *adev = amdgpu_ttm_adev(abo->tbo.bdev); in amdgpu_bo_placement_from_domain()
284 r = amdgpu_ttm_alloc_gart(&(*bo_ptr)->tbo); in amdgpu_bo_create_reserved()
393 ttm_resource_free(&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); in amdgpu_bo_create_kernel_at()
399 r = ttm_bo_mem_space(&(*bo_ptr)->tbo, &(*bo_ptr)->placement, in amdgpu_bo_create_kernel_at()
400 &(*bo_ptr)->tbo.mem, &ctx); in amdgpu_bo_create_kernel_at()
564 drm_gem_private_object_init(adev_to_drm(adev), &bo->tbo.base, size); in amdgpu_bo_do_create()
579 bo->tbo.bdev = &adev->mman.bdev; in amdgpu_bo_do_create()
586 bo->tbo.priority = 1; in amdgpu_bo_do_create()
588 r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, bp->type, in amdgpu_bo_do_create()
595 bo->tbo.mem.mem_type == TTM_PL_VRAM && in amdgpu_bo_do_create()
596 bo->tbo.mem.start < adev->gmc.visible_vram_size >> PAGE_SHIFT) in amdgpu_bo_do_create()
603 bo->tbo.mem.mem_type == TTM_PL_VRAM) { in amdgpu_bo_do_create()
606 r = amdgpu_fill_buffer(bo, 0, bo->tbo.base.resv, &fence); in amdgpu_bo_do_create()
611 dma_fence_put(bo->tbo.moving); in amdgpu_bo_do_create()
612 bo->tbo.moving = dma_fence_get(fence); in amdgpu_bo_do_create()
629 dma_resv_unlock(bo->tbo.base.resv); in amdgpu_bo_do_create()
650 bp.resv = bo->tbo.base.resv; in amdgpu_bo_create_shadow()
691 WARN_ON(dma_resv_lock((*bo_ptr)->tbo.base.resv, in amdgpu_bo_create()
697 dma_resv_unlock((*bo_ptr)->tbo.base.resv); in amdgpu_bo_create()
731 r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); in amdgpu_bo_validate()
756 struct amdgpu_device *adev = amdgpu_ttm_adev(shadow->tbo.bdev); in amdgpu_bo_restore_shadow()
794 r = dma_resv_wait_timeout_rcu(bo->tbo.base.resv, false, false, in amdgpu_bo_kmap()
799 r = ttm_bo_kmap(&bo->tbo, 0, bo->tbo.num_pages, &bo->kmap); in amdgpu_bo_kmap()
851 ttm_bo_get(&bo->tbo); in amdgpu_bo_ref()
863 struct ttm_buffer_object *tbo; in amdgpu_bo_unref() local
868 tbo = &((*bo)->tbo); in amdgpu_bo_unref()
869 ttm_bo_put(tbo); in amdgpu_bo_unref()
898 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_pin_restricted()
902 if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm)) in amdgpu_bo_pin_restricted()
922 uint32_t mem_type = bo->tbo.mem.mem_type; in amdgpu_bo_pin_restricted()
939 if (bo->tbo.base.import_attach) in amdgpu_bo_pin_restricted()
940 dma_buf_pin(bo->tbo.base.import_attach); in amdgpu_bo_pin_restricted()
961 r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); in amdgpu_bo_pin_restricted()
969 domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type); in amdgpu_bo_pin_restricted()
1011 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_unpin()
1025 if (bo->tbo.base.import_attach) in amdgpu_bo_unpin()
1026 dma_buf_unpin(bo->tbo.base.import_attach); in amdgpu_bo_unpin()
1032 r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); in amdgpu_bo_unpin()
1146 return ttm_bo_mmap_obj(vma, &bo->tbo); in amdgpu_bo_fbdev_mmap()
1162 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_set_tiling_flags()
1182 dma_resv_assert_held(bo->tbo.base.resv); in amdgpu_bo_get_tiling_flags()
1294 if (abo->tbo.base.dma_buf && !abo->tbo.base.import_attach && in amdgpu_bo_move_notify()
1296 dma_buf_move_notify(abo->tbo.base.dma_buf); in amdgpu_bo_move_notify()
1424 struct dma_resv *resv = bo->tbo.base.resv; in amdgpu_bo_fence()
1472 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_sync_wait()
1474 return amdgpu_bo_sync_wait_resv(adev, bo->tbo.base.resv, in amdgpu_bo_sync_wait()
1490 WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_SYSTEM); in amdgpu_bo_gpu_offset()
1491 WARN_ON_ONCE(!dma_resv_is_locked(bo->tbo.base.resv) && in amdgpu_bo_gpu_offset()
1492 !bo->pin_count && bo->tbo.type != ttm_bo_type_kernel); in amdgpu_bo_gpu_offset()
1493 WARN_ON_ONCE(bo->tbo.mem.start == AMDGPU_BO_INVALID_OFFSET); in amdgpu_bo_gpu_offset()
1494 WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_VRAM && in amdgpu_bo_gpu_offset()
1509 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_gpu_offset_no_check()
1512 offset = (bo->tbo.mem.start << PAGE_SHIFT) + in amdgpu_bo_gpu_offset_no_check()
1513 amdgpu_ttm_domain_start(adev, bo->tbo.mem.mem_type); in amdgpu_bo_gpu_offset_no_check()