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);
123 struct amdgpu_bo bo; member
132 struct amdgpu_bo bo; member
202 static inline int amdgpu_bo_reserve(struct amdgpu_bo *bo, bool no_intr) in amdgpu_bo_reserve() argument
204 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_reserve()
207 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL); in amdgpu_bo_reserve()
210 dev_err(adev->dev, "%p reserve failed\n", bo); in amdgpu_bo_reserve()
216 static inline void amdgpu_bo_unreserve(struct amdgpu_bo *bo) in amdgpu_bo_unreserve() argument
218 ttm_bo_unreserve(&bo->tbo); in amdgpu_bo_unreserve()
221 static inline unsigned long amdgpu_bo_size(struct amdgpu_bo *bo) in amdgpu_bo_size() argument
223 return bo->tbo.base.size; in amdgpu_bo_size()
226 static inline unsigned amdgpu_bo_ngpu_pages(struct amdgpu_bo *bo) in amdgpu_bo_ngpu_pages() argument
228 return bo->tbo.base.size / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_ngpu_pages()
231 static inline unsigned amdgpu_bo_gpu_page_alignment(struct amdgpu_bo *bo) in amdgpu_bo_gpu_page_alignment() argument
233 return (bo->tbo.page_alignment << PAGE_SHIFT) / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_gpu_page_alignment()
242 static inline u64 amdgpu_bo_mmap_offset(struct amdgpu_bo *bo) in amdgpu_bo_mmap_offset() argument
244 return drm_vma_node_offset_addr(&bo->tbo.base.vma_node); in amdgpu_bo_mmap_offset()
250 static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo) in amdgpu_bo_in_cpu_visible_vram() argument
252 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_in_cpu_visible_vram()
255 if (!bo->tbo.resource || bo->tbo.resource->mem_type != TTM_PL_VRAM) in amdgpu_bo_in_cpu_visible_vram()
258 amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor); in amdgpu_bo_in_cpu_visible_vram()
272 static inline bool amdgpu_bo_explicit_sync(struct amdgpu_bo *bo) in amdgpu_bo_explicit_sync() argument
274 return bo->flags & AMDGPU_GEM_CREATE_EXPLICIT_SYNC; in amdgpu_bo_explicit_sync()
283 static inline bool amdgpu_bo_encrypted(struct amdgpu_bo *bo) in amdgpu_bo_encrypted() argument
285 return bo->flags & AMDGPU_GEM_CREATE_ENCRYPTED; in amdgpu_bo_encrypted()
296 static inline struct amdgpu_bo *amdgpu_bo_shadowed(struct amdgpu_bo *bo) in amdgpu_bo_shadowed() argument
298 if (bo->tbo.type == ttm_bo_type_kernel) in amdgpu_bo_shadowed()
299 return to_amdgpu_bo_vm(bo)->shadow; in amdgpu_bo_shadowed()
304 bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
327 void amdgpu_bo_free_kernel(struct amdgpu_bo **bo, u64 *gpu_addr,
329 int amdgpu_bo_kmap(struct amdgpu_bo *bo, void **ptr);
330 void *amdgpu_bo_kptr(struct amdgpu_bo *bo);
331 void amdgpu_bo_kunmap(struct amdgpu_bo *bo);
332 struct amdgpu_bo *amdgpu_bo_ref(struct amdgpu_bo *bo);
333 void amdgpu_bo_unref(struct amdgpu_bo **bo);
334 int amdgpu_bo_pin(struct amdgpu_bo *bo, u32 domain);
335 int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
337 void amdgpu_bo_unpin(struct amdgpu_bo *bo);
340 int amdgpu_bo_set_tiling_flags(struct amdgpu_bo *bo, u64 tiling_flags);
341 void amdgpu_bo_get_tiling_flags(struct amdgpu_bo *bo, u64 *tiling_flags);
342 int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
344 int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer,
347 void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
350 void amdgpu_bo_release_notify(struct ttm_buffer_object *bo);
351 vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
352 void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence,
357 int amdgpu_bo_sync_wait(struct amdgpu_bo *bo, void *owner, bool intr);
358 u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo);
359 u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo);
360 void amdgpu_bo_get_memory(struct amdgpu_bo *bo,
405 u64 amdgpu_bo_print_info(int id, struct amdgpu_bo *bo, struct seq_file *m);