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

Wait for all fences on the requested ring to signal (all asics).
Returns 0 if the fences have passed, error for all other cases.
Caller must hold ring lock.
wait for all fences to signal @rdev : radeon device pointer @ring : ring index the fence is associated with Wait for all fences on the requested ring to signal ( all asics ) . Returns 0 if the fences have passed error for all other cases . Caller must hold ring lock .
int radeon_fence_wait_empty_locked(struct radeon_device *rdev, int ring)
{
	uint64_t seq = rdev->fence_drv[ring].sync_seq[ring];
	int r;
	r = radeon_fence_wait_seq(rdev, seq, ring, false, false);
	if (r) {
		if (r == -EDEADLK) {
			return -EDEADLK;
		}
		dev_err(rdev->dev, "error waiting for ring[%d] to become idle (%d)\n",
			ring, r);
	}
	return 0;
}
int radeon_fence_wait_empty_locked ( struct radeon_device * rdev , int ring ) { uint64_t seq = rdev -> fence_drv [ ring ] . sync_seq [ ring ] ; int r ; r = radeon_fence_wait_seq ( rdev , seq , ring , false , false ) ; if ( r ) { if ( r == - EDEADLK ) { return - EDEADLK ; } dev_err ( rdev -> dev , " \n " , ring , r ) ; } return 0 ; }
radeon_fence_wait_empty_locked - wait for all fences to signal
 @rdev: radeon device pointer
 @ring: ring index the fence is associated with
radeon_fence_wait_empty_locked - wait for all fences to signal @rdev : radeon device pointer @ring : ring index the fence is associated with