<def f='src/src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_driver.h' l='939' ll='953' type='int ttm_bo_reserve(struct ttm_buffer_object * bo, _Bool interruptible, _Bool no_wait, _Bool use_ticket, struct ww_acquire_ctx * ticket)'/>
<doc f='src/src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_driver.h' l='894'>/**
 * ttm_bo_reserve:
 *
 * @bo: A pointer to a struct ttm_buffer_object.
 * @interruptible: Sleep interruptible if waiting.
 * @no_wait: Don&apos;t sleep while trying to reserve, rather return -EBUSY.
 * @use_ticket: If @bo is already reserved, Only sleep waiting for
 * it to become unreserved if @ticket-&gt;stamp is older.
 *
 * Locks a buffer object for validation. (Or prevents other processes from
 * locking it for validation) and removes it from lru lists, while taking
 * a number of measures to prevent deadlocks.
 *
 * Deadlocks may occur when two processes try to reserve multiple buffers in
 * different order, either by will or as a result of a buffer being evicted
 * to make room for a buffer already reserved. (Buffers are reserved before
 * they are evicted). The following algorithm prevents such deadlocks from
 * occurring:
 * Processes attempting to reserve multiple buffers other than for eviction,
 * (typically execbuf), should first obtain a unique 32-bit
 * validation sequence number,
 * and call this function with @use_ticket == 1 and @ticket-&gt;stamp == the unique
 * sequence number. If upon call of this function, the buffer object is already
 * reserved, the validation sequence is checked against the validation
 * sequence of the process currently reserving the buffer,
 * and if the current validation sequence is greater than that of the process
 * holding the reservation, the function returns -EAGAIN. Otherwise it sleeps
 * waiting for the buffer to become unreserved, after which it retries
 * reserving.
 * The caller should, when receiving an -EAGAIN error
 * release all its buffer reservations, wait for @bo to become unreserved, and
 * then rerun the validation with the same validation sequence. This procedure
 * will always guarantee that the process with the lowest validation sequence
 * will eventually succeed, preventing both deadlocks and starvation.
 *
 * Returns:
 * -EDEADLK: The reservation may cause a deadlock.
 * Release all buffer reservations, wait for @bo to become unreserved and
 * try again. (only if use_sequence == 1).
 * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
 * a signal. Release all buffer reservations and return to user-space.
 * -EBUSY: The function needed to sleep, but @no_wait was true
 * -EALREADY: Bo already reserved using @ticket. This error code will only
 * be returned if @use_ticket is set to true.
 */</doc>
<use f='src/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c' l='321' u='c' c='nouveau_bo_pin'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c' l='362' u='c' c='nouveau_bo_unpin'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c' l='397' u='c' c='nouveau_bo_map'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_display.c' l='736' u='c' c='nouveau_crtc_page_flip'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c' l='78' u='c' c='nouveau_gem_object_open'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c' l='149' u='c' c='nouveau_gem_object_close'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c' l='401' u='c' c='validate_init'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_object.h' l='68' u='c' c='radeon_bo_reserve'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c' l='749' u='c' c='radeon_bo_wait'/>
<use f='src/src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c' l='1722' u='c' c='ttm_bo_synccpu_write_grab'/>
<use f='src/src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c' l='105' u='c' c='ttm_bo_uvm_fault'/>
