Lines Matching refs:bo

46 #define to_amdgpu_bo_user(abo) container_of((abo), struct amdgpu_bo_user, bo)
47 #define to_amdgpu_bo_vm(abo) container_of((abo), struct amdgpu_bo_vm, bo)
59 void (*destroy)(struct ttm_buffer_object *bo);
115 struct amdgpu_bo bo; member
124 struct amdgpu_bo bo; member
171 static inline int amdgpu_bo_reserve(struct amdgpu_bo *bo, bool no_intr) in amdgpu_bo_reserve() argument
173 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_reserve()
176 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL); in amdgpu_bo_reserve()
179 dev_err(adev->dev, "%p reserve failed\n", bo); in amdgpu_bo_reserve()
185 static inline void amdgpu_bo_unreserve(struct amdgpu_bo *bo) in amdgpu_bo_unreserve() argument
187 ttm_bo_unreserve(&bo->tbo); in amdgpu_bo_unreserve()
190 static inline unsigned long amdgpu_bo_size(struct amdgpu_bo *bo) in amdgpu_bo_size() argument
192 return bo->tbo.base.size; in amdgpu_bo_size()
195 static inline unsigned amdgpu_bo_ngpu_pages(struct amdgpu_bo *bo) in amdgpu_bo_ngpu_pages() argument
197 return bo->tbo.base.size / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_ngpu_pages()
200 static inline unsigned amdgpu_bo_gpu_page_alignment(struct amdgpu_bo *bo) in amdgpu_bo_gpu_page_alignment() argument
202 return (bo->tbo.page_alignment << PAGE_SHIFT) / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_gpu_page_alignment()
211 static inline u64 amdgpu_bo_mmap_offset(struct amdgpu_bo *bo) in amdgpu_bo_mmap_offset() argument
213 return drm_vma_node_offset_addr(&bo->tbo.base.vma_node); in amdgpu_bo_mmap_offset()
219 static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo) in amdgpu_bo_in_cpu_visible_vram() argument
221 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_in_cpu_visible_vram()
224 if (bo->tbo.resource->mem_type != TTM_PL_VRAM) in amdgpu_bo_in_cpu_visible_vram()
227 amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor); in amdgpu_bo_in_cpu_visible_vram()
241 static inline bool amdgpu_bo_explicit_sync(struct amdgpu_bo *bo) in amdgpu_bo_explicit_sync() argument
243 return bo->flags & AMDGPU_GEM_CREATE_EXPLICIT_SYNC; in amdgpu_bo_explicit_sync()
252 static inline bool amdgpu_bo_encrypted(struct amdgpu_bo *bo) in amdgpu_bo_encrypted() argument
254 return bo->flags & AMDGPU_GEM_CREATE_ENCRYPTED; in amdgpu_bo_encrypted()
265 static inline struct amdgpu_bo *amdgpu_bo_shadowed(struct amdgpu_bo *bo) in amdgpu_bo_shadowed() argument
267 if (bo->tbo.type == ttm_bo_type_kernel) in amdgpu_bo_shadowed()
268 return to_amdgpu_bo_vm(bo)->shadow; in amdgpu_bo_shadowed()
273 bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
296 void amdgpu_bo_free_kernel(struct amdgpu_bo **bo, u64 *gpu_addr,
298 int amdgpu_bo_kmap(struct amdgpu_bo *bo, void **ptr);
299 void *amdgpu_bo_kptr(struct amdgpu_bo *bo);
300 void amdgpu_bo_kunmap(struct amdgpu_bo *bo);
301 struct amdgpu_bo *amdgpu_bo_ref(struct amdgpu_bo *bo);
302 void amdgpu_bo_unref(struct amdgpu_bo **bo);
303 int amdgpu_bo_pin(struct amdgpu_bo *bo, u32 domain);
304 int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
306 void amdgpu_bo_unpin(struct amdgpu_bo *bo);
309 int amdgpu_bo_set_tiling_flags(struct amdgpu_bo *bo, u64 tiling_flags);
310 void amdgpu_bo_get_tiling_flags(struct amdgpu_bo *bo, u64 *tiling_flags);
311 int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
313 int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer,
316 void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
319 void amdgpu_bo_release_notify(struct ttm_buffer_object *bo);
320 vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
321 void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence,
326 int amdgpu_bo_sync_wait(struct amdgpu_bo *bo, void *owner, bool intr);
327 u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo);
328 u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo);
329 void amdgpu_bo_get_memory(struct amdgpu_bo *bo, uint64_t *vram_mem,
367 u64 amdgpu_bo_print_info(int id, struct amdgpu_bo *bo, struct seq_file *m);