FreeBSD/sys/dev/drm2/radeon/radeon_fence.c
/**
 * radeon_fence_wait_next_locked - wait for the next fence to signal
 *
 * @rdev: radeon device pointer
 * @ring: ring index the fence is associated with
 *
 * Wait for the next fence on the requested ring to signal (all asics).
 * Returns 0 if the next fence has passed, error for all other cases.
 * Caller must hold ring lock.
 */
wait for the next fence to signal
@rdev: radeon device pointer
@ring: ring index the fence is associated with

Wait for the next fence on the requested ring to signal (all asics).
Returns 0 if the next fence has passed, error for all other cases.
Caller must hold ring lock.
wait for the next fence to signal @rdev : radeon device pointer @ring : ring index the fence is associated with Wait for the next fence on the requested ring to signal ( all asics ) . Returns 0 if the next fence has passed error for all other cases . Caller must hold ring lock .
int radeon_fence_wait_next_locked(struct radeon_device *rdev, int ring)
{
	uint64_t seq;
	seq = atomic64_read(&rdev->fence_drv[ring].last_seq) + 1ULL;
	if (seq >= rdev->fence_drv[ring].sync_seq[ring]) {
		return -ENOENT;
	}
	return radeon_fence_wait_seq(rdev, seq, ring, false, false);
}
int radeon_fence_wait_next_locked ( struct radeon_device * rdev , int ring ) { uint64_t seq ; seq = atomic64_read ( & rdev -> fence_drv [ ring ] . last_seq ) + 1ULL ; if ( seq >= rdev -> fence_drv [ ring ] . sync_seq [ ring ] ) { return - ENOENT ; } return radeon_fence_wait_seq ( rdev , seq , ring , false , false ) ; }
radeon_fence_wait_next_locked - wait for the next fence to signal
 @rdev: radeon device pointer
 @ring: ring index the fence is associated with
radeon_fence_wait_next_locked - wait for the next fence to signal @rdev : radeon device pointer @ring : ring index the fence is associated with
/* nothing to wait for, last_seq is
		   already the last emitted fence */