Lines Matching refs:bo
151 static inline int amdgpu_bo_reserve(struct amdgpu_bo *bo, bool no_intr) in amdgpu_bo_reserve() argument
153 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_reserve()
156 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL); in amdgpu_bo_reserve()
159 dev_err(adev->dev, "%p reserve failed\n", bo); in amdgpu_bo_reserve()
165 static inline void amdgpu_bo_unreserve(struct amdgpu_bo *bo) in amdgpu_bo_unreserve() argument
167 ttm_bo_unreserve(&bo->tbo); in amdgpu_bo_unreserve()
170 static inline unsigned long amdgpu_bo_size(struct amdgpu_bo *bo) in amdgpu_bo_size() argument
172 return bo->tbo.num_pages << PAGE_SHIFT; in amdgpu_bo_size()
175 static inline unsigned amdgpu_bo_ngpu_pages(struct amdgpu_bo *bo) in amdgpu_bo_ngpu_pages() argument
177 return (bo->tbo.num_pages << PAGE_SHIFT) / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_ngpu_pages()
180 static inline unsigned amdgpu_bo_gpu_page_alignment(struct amdgpu_bo *bo) in amdgpu_bo_gpu_page_alignment() argument
182 return (bo->tbo.mem.page_alignment << PAGE_SHIFT) / AMDGPU_GPU_PAGE_SIZE; in amdgpu_bo_gpu_page_alignment()
191 static inline u64 amdgpu_bo_mmap_offset(struct amdgpu_bo *bo) in amdgpu_bo_mmap_offset() argument
193 return drm_vma_node_offset_addr(&bo->tbo.vma_node); in amdgpu_bo_mmap_offset()
200 static inline bool amdgpu_bo_gpu_accessible(struct amdgpu_bo *bo) in amdgpu_bo_gpu_accessible() argument
202 switch (bo->tbo.mem.mem_type) { in amdgpu_bo_gpu_accessible()
203 case TTM_PL_TT: return amdgpu_gtt_mgr_has_gart_addr(&bo->tbo.mem); in amdgpu_bo_gpu_accessible()
212 static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo) in amdgpu_bo_in_cpu_visible_vram() argument
214 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); in amdgpu_bo_in_cpu_visible_vram()
216 struct drm_mm_node *node = bo->tbo.mem.mm_node; in amdgpu_bo_in_cpu_visible_vram()
219 if (bo->tbo.mem.mem_type != TTM_PL_VRAM) in amdgpu_bo_in_cpu_visible_vram()
222 for (pages_left = bo->tbo.mem.num_pages; pages_left; in amdgpu_bo_in_cpu_visible_vram()
233 static inline bool amdgpu_bo_explicit_sync(struct amdgpu_bo *bo) in amdgpu_bo_explicit_sync() argument
235 return bo->flags & AMDGPU_GEM_CREATE_EXPLICIT_SYNC; in amdgpu_bo_explicit_sync()
238 bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
252 void amdgpu_bo_free_kernel(struct amdgpu_bo **bo, u64 *gpu_addr,
254 int amdgpu_bo_kmap(struct amdgpu_bo *bo, void **ptr);
255 void *amdgpu_bo_kptr(struct amdgpu_bo *bo);
256 void amdgpu_bo_kunmap(struct amdgpu_bo *bo);
257 struct amdgpu_bo *amdgpu_bo_ref(struct amdgpu_bo *bo);
258 void amdgpu_bo_unref(struct amdgpu_bo **bo);
259 int amdgpu_bo_pin(struct amdgpu_bo *bo, u32 domain);
260 int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
262 int amdgpu_bo_unpin(struct amdgpu_bo *bo);
267 int amdgpu_bo_fbdev_mmap(struct amdgpu_bo *bo,
269 int amdgpu_bo_set_tiling_flags(struct amdgpu_bo *bo, u64 tiling_flags);
270 void amdgpu_bo_get_tiling_flags(struct amdgpu_bo *bo, u64 *tiling_flags);
271 int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
273 int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer,
276 void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
279 int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
280 void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence,
282 u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo);
285 struct amdgpu_bo *bo,
288 int amdgpu_bo_validate(struct amdgpu_bo *bo);
291 struct amdgpu_bo *bo,