Lines Matching refs:bo
78 * @type: The bo type.
115 * Members protected by the bo::resv::reserved lock.
132 * and the bo::lock when written to. Can be read with
145 * Object describing a kernel mapping. Since a TTM bo may be located
160 struct ttm_buffer_object *bo;
191 * @bo: The buffer object.
193 static inline void ttm_bo_get(struct ttm_buffer_object *bo)
195 kref_get(&bo->kref);
201 * @bo: The buffer object.
206 * Returns: @bo if the referencing was successful, NULL otherwise.
209 ttm_bo_get_unless_zero(struct ttm_buffer_object *bo)
211 if (!kref_get_unless_zero(&bo->kref))
213 return bo;
219 * @bo: A pointer to a struct ttm_buffer_object.
230 * Release all buffer reservations, wait for @bo to become unreserved and
238 static inline int ttm_bo_reserve(struct ttm_buffer_object *bo,
250 success = dma_resv_trylock(bo->base.resv);
255 ret = dma_resv_lock_interruptible(bo->base.resv, ticket);
257 ret = dma_resv_lock(bo->base.resv, ticket);
265 * @bo: A pointer to a struct ttm_buffer_object.
267 * @sequence: Set (@bo)->sequence to this value after lock
273 static inline int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo,
278 int ret = dma_resv_lock_slow_interruptible(bo->base.resv,
284 dma_resv_lock_slow(bo->base.resv, ticket);
288 void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo);
291 ttm_bo_move_to_lru_tail_unlocked(struct ttm_buffer_object *bo)
293 spin_lock(&bo->bdev->lru_lock);
294 ttm_bo_move_to_lru_tail(bo);
295 spin_unlock(&bo->bdev->lru_lock);
298 static inline void ttm_bo_assign_mem(struct ttm_buffer_object *bo,
301 WARN_ON(bo->resource);
302 bo->resource = new_mem;
307 * @bo: The bo to assign the memory to
310 * Assign the memory from new_mem to the memory of the buffer object bo.
312 static inline void ttm_bo_move_null(struct ttm_buffer_object *bo,
315 ttm_resource_free(bo, &bo->resource);
316 ttm_bo_assign_mem(bo, new_mem);
322 * @bo: A pointer to a struct ttm_buffer_object.
324 * Unreserve a previous reservation of @bo.
326 static inline void ttm_bo_unreserve(struct ttm_buffer_object *bo)
328 ttm_bo_move_to_lru_tail_unlocked(bo);
329 dma_resv_unlock(bo->base.resv);
350 int ttm_bo_wait_ctx(struct ttm_buffer_object *bo,
352 int ttm_bo_validate(struct ttm_buffer_object *bo,
355 void ttm_bo_put(struct ttm_buffer_object *bo);
356 void ttm_bo_set_bulk_move(struct ttm_buffer_object *bo,
358 bool ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
360 int ttm_bo_init_reserved(struct ttm_device *bdev, struct ttm_buffer_object *bo,
365 int ttm_bo_init_validate(struct ttm_device *bdev, struct ttm_buffer_object *bo,
370 int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page,
373 int ttm_bo_vmap(struct ttm_buffer_object *bo, struct iosys_map *map);
374 void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct iosys_map *map);
375 int ttm_bo_mmap_obj(struct vm_area_struct *vma, struct ttm_buffer_object *bo);
376 int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
378 void ttm_bo_pin(struct ttm_buffer_object *bo);
379 void ttm_bo_unpin(struct ttm_buffer_object *bo);
385 vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
397 int ttm_bo_mem_space(struct ttm_buffer_object *bo,
402 void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo);
413 int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
416 int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
420 void ttm_bo_move_sync_cleanup(struct ttm_buffer_object *bo,
422 int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo);
423 pgprot_t ttm_io_prot(struct ttm_buffer_object *bo, struct ttm_resource *res,
425 void ttm_bo_tt_destroy(struct ttm_buffer_object *bo);