Lines Matching refs:bo
52 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_dma_buf_pin() local
53 struct xe_device *xe = xe_bo_device(bo); in xe_dma_buf_pin()
61 if (xe_bo_is_pinned(bo) && bo->ttm.resource->placement != XE_PL_TT) { in xe_dma_buf_pin()
66 ret = xe_bo_migrate(bo, XE_PL_TT); in xe_dma_buf_pin()
75 ret = xe_bo_pin_external(bo); in xe_dma_buf_pin()
84 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_dma_buf_unpin() local
86 xe_bo_unpin_external(bo); in xe_dma_buf_unpin()
94 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_dma_buf_map() local
98 if (!attach->peer2peer && !xe_bo_can_migrate(bo, XE_PL_TT)) in xe_dma_buf_map()
101 if (!xe_bo_is_pinned(bo)) { in xe_dma_buf_map()
103 r = xe_bo_migrate(bo, XE_PL_TT); in xe_dma_buf_map()
105 r = xe_bo_validate(bo, NULL, false); in xe_dma_buf_map()
110 switch (bo->ttm.resource->mem_type) { in xe_dma_buf_map()
113 bo->ttm.ttm->pages, in xe_dma_buf_map()
114 bo->ttm.ttm->num_pages); in xe_dma_buf_map()
125 r = xe_ttm_vram_mgr_alloc_sgt(xe_bo_device(bo), in xe_dma_buf_map()
126 bo->ttm.resource, 0, in xe_dma_buf_map()
127 bo->ttm.base.size, attach->dev, in xe_dma_buf_map()
149 struct xe_bo *bo = gem_to_xe_bo(dma_buf->priv); in xe_dma_buf_unmap() local
151 if (!xe_bo_is_vram(bo)) { in xe_dma_buf_unmap()
164 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_dma_buf_begin_cpu_access() local
172 xe_bo_lock(bo, false); in xe_dma_buf_begin_cpu_access()
173 (void)xe_bo_migrate(bo, XE_PL_TT); in xe_dma_buf_begin_cpu_access()
174 xe_bo_unlock(bo); in xe_dma_buf_begin_cpu_access()
195 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_gem_prime_export() local
198 if (bo->vm) in xe_gem_prime_export()
214 struct xe_bo *bo; in xe_dma_buf_init_obj() local
218 bo = ___xe_bo_create_locked(xe, storage, NULL, resv, NULL, dma_buf->size, in xe_dma_buf_init_obj()
221 if (IS_ERR(bo)) { in xe_dma_buf_init_obj()
222 ret = PTR_ERR(bo); in xe_dma_buf_init_obj()
227 return &bo->ttm.base; in xe_dma_buf_init_obj()
237 struct xe_bo *bo = gem_to_xe_bo(obj); in xe_dma_buf_move_notify() local
239 XE_WARN_ON(xe_bo_evict(bo, false)); in xe_dma_buf_move_notify()
269 struct xe_bo *bo; in xe_gem_prime_import() local
289 bo = xe_bo_alloc(); in xe_gem_prime_import()
290 if (IS_ERR(bo)) in xe_gem_prime_import()
291 return ERR_CAST(bo); in xe_gem_prime_import()
299 attach = dma_buf_dynamic_attach(dma_buf, dev->dev, attach_ops, &bo->ttm.base); in xe_gem_prime_import()
306 obj = xe_dma_buf_init_obj(dev, bo, dma_buf); in xe_gem_prime_import()
316 xe_bo_free(bo); in xe_gem_prime_import()