sys/dev/drm/radeon/radeon_fence.c
/**
 * radeon_fence_wait_any - wait for a fence to signal on any ring
 *
 * @rdev: radeon device pointer
 * @fences: radeon fence object(s)
 * @intr: use interruptable sleep
 *
 * Wait for any requested fence to signal (all asics).  Fence
 * array is indexed by ring id.  @intr selects whether to use
 * interruptable (true) or non-interruptable (false) sleep when
 * waiting for the fences. Used by the suballocator.
 * Returns 0 if any fence has passed, error for all other cases.
 */
wait for a fence to signal on any ring
@rdev: radeon device pointer
@fences: radeon fence object(s)
@intr: use interruptable sleep

Wait for any requested fence to signal (all asics).  Fence
array is indexed by ring id.  @intr selects whether to use
interruptable (true) or non-interruptable (false) sleep when
waiting for the fences. Used by the suballocator.
Returns 0 if any fence has passed, error for all other cases.
wait for a fence to signal on any ring @rdev : radeon device pointer @fences : radeon fence object ( s ) @intr : use interruptable sleep Wait for any requested fence to signal ( all asics ) . Fence array is indexed by ring id . @intr selects whether to use interruptable ( true ) or non - interruptable ( false ) sleep when waiting for the fences . Used by the suballocator . Returns 0 if any fence has passed error for all other cases .
int radeon_fence_wait_any(struct radeon_device *rdev,
			  struct radeon_fence **fences,
			  bool intr)
{
	uint64_t seq[RADEON_NUM_RINGS];
	unsigned i;
	int r;
	for (i = 0; i < RADEON_NUM_RINGS; ++i) {
		seq[i] = 0;
		if (!fences[i]) {
			continue;
		}
		if (fences[i]->seq == RADEON_FENCE_SIGNALED_SEQ) {
			return 0;
		}
		seq[i] = fences[i]->seq;
	}
	r = radeon_fence_wait_any_seq(rdev, seq, intr);
	if (r) {
		return r;
	}
	return 0;
}
int radeon_fence_wait_any ( struct radeon_device * rdev , struct radeon_fence * * fences , bool intr ) { uint64_t seq [ RADEON_NUM_RINGS ] ; unsigned i ; int r ; for ( i = 0 ; i < RADEON_NUM_RINGS ; ++ i ) { seq [ i ] = 0 ; if ( ! fences [ i ] ) { continue ; } if ( fences [ i ] -> seq == RADEON_FENCE_SIGNALED_SEQ ) { return 0 ; } seq [ i ] = fences [ i ] -> seq ; } r = radeon_fence_wait_any_seq ( rdev , seq , intr ) ; if ( r ) { return r ; } return 0 ; }
radeon_fence_wait_any - wait for a fence to signal on any ring
 @rdev: radeon device pointer
 @fences: radeon fence object(s)
 @intr: use interruptable sleep
radeon_fence_wait_any - wait for a fence to signal on any ring @rdev : radeon device pointer @fences : radeon fence object ( s ) @intr : use interruptable sleep
/* something was allready signaled */