Lines Matching refs:bo
45 #define to_amdgpu_bo_user(abo) container_of((abo), struct amdgpu_bo_user, bo)
46 #define to_amdgpu_bo_vm(abo) container_of((abo), struct amdgpu_bo_vm, bo)
58 void (*destroy)(struct ttm_buffer_object *bo);
114 struct amdgpu_bo bo; member
123 struct amdgpu_bo bo; member
170 static inline int amdgpu_bo_reserve(struct amdgpu_bo *bo, bool no_intr) in amdgpu_bo_reserve() argument
172 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_reserve()
175 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL); in amdgpu_bo_reserve()
178 dev_err(adev->dev, "%p reserve failed\n", bo); in amdgpu_bo_reserve()
184 static inline void amdgpu_bo_unreserve(struct amdgpu_bo *bo) in amdgpu_bo_unreserve() argument
186 ttm_bo_unreserve(&bo->tbo); in amdgpu_bo_unreserve()
189 static inline unsigned long amdgpu_bo_size(struct amdgpu_bo *bo) in amdgpu_bo_size() argument
191 return bo->tbo.base.size; in amdgpu_bo_size()
194 static inline unsigned amdgpu_bo_ngpu_pages(struct amdgpu_bo *bo) in amdgpu_bo_ngpu_pages() argument
196 return bo->tbo.base.size / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_ngpu_pages()
199 static inline unsigned amdgpu_bo_gpu_page_alignment(struct amdgpu_bo *bo) in amdgpu_bo_gpu_page_alignment() argument
201 return (bo->tbo.page_alignment << PAGE_SHIFT) / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_gpu_page_alignment()
210 static inline u64 amdgpu_bo_mmap_offset(struct amdgpu_bo *bo) in amdgpu_bo_mmap_offset() argument
212 return drm_vma_node_offset_addr(&bo->tbo.base.vma_node); in amdgpu_bo_mmap_offset()
218 static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo) in amdgpu_bo_in_cpu_visible_vram() argument
220 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_in_cpu_visible_vram()
223 if (bo->tbo.resource->mem_type != TTM_PL_VRAM) in amdgpu_bo_in_cpu_visible_vram()
226 amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor); in amdgpu_bo_in_cpu_visible_vram()
240 static inline bool amdgpu_bo_explicit_sync(struct amdgpu_bo *bo) in amdgpu_bo_explicit_sync() argument
242 return bo->flags & AMDGPU_GEM_CREATE_EXPLICIT_SYNC; in amdgpu_bo_explicit_sync()
251 static inline bool amdgpu_bo_encrypted(struct amdgpu_bo *bo) in amdgpu_bo_encrypted() argument
253 return bo->flags & AMDGPU_GEM_CREATE_ENCRYPTED; in amdgpu_bo_encrypted()
264 static inline struct amdgpu_bo *amdgpu_bo_shadowed(struct amdgpu_bo *bo) in amdgpu_bo_shadowed() argument
266 if (bo->tbo.type == ttm_bo_type_kernel) in amdgpu_bo_shadowed()
267 return to_amdgpu_bo_vm(bo)->shadow; in amdgpu_bo_shadowed()
272 bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
295 void amdgpu_bo_free_kernel(struct amdgpu_bo **bo, u64 *gpu_addr,
297 int amdgpu_bo_kmap(struct amdgpu_bo *bo, void **ptr);
298 void *amdgpu_bo_kptr(struct amdgpu_bo *bo);
299 void amdgpu_bo_kunmap(struct amdgpu_bo *bo);
300 struct amdgpu_bo *amdgpu_bo_ref(struct amdgpu_bo *bo);
301 void amdgpu_bo_unref(struct amdgpu_bo **bo);
302 int amdgpu_bo_pin(struct amdgpu_bo *bo, u32 domain);
303 int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
305 void amdgpu_bo_unpin(struct amdgpu_bo *bo);
308 int amdgpu_bo_set_tiling_flags(struct amdgpu_bo *bo, u64 tiling_flags);
309 void amdgpu_bo_get_tiling_flags(struct amdgpu_bo *bo, u64 *tiling_flags);
310 int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
312 int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer,
315 void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
318 void amdgpu_bo_release_notify(struct ttm_buffer_object *bo);
319 vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
320 void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence,
325 int amdgpu_bo_sync_wait(struct amdgpu_bo *bo, void *owner, bool intr);
326 u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo);
327 u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo);
328 void amdgpu_bo_get_memory(struct amdgpu_bo *bo, uint64_t *vram_mem,
366 u64 amdgpu_bo_print_info(int id, struct amdgpu_bo *bo, struct seq_file *m);