FreeBSD/sys/dev/drm2/radeon/radeon_fence.c
/**
 * radeon_fence_emit - emit a fence on the requested ring
 *
 * @rdev: radeon_device pointer
 * @fence: radeon fence object
 * @ring: ring index the fence is associated with
 *
 * Emits a fence command on the requested ring (all asics).
 * Returns 0 on success, -ENOMEM on failure.
 */
emit a fence on the requested ring
@rdev: radeon_device pointer
@fence: radeon fence object
@ring: ring index the fence is associated with

Emits a fence command on the requested ring (all asics).
Returns 0 on success, -ENOMEM on failure.
emit a fence on the requested ring @rdev : radeon_device pointer @fence : radeon fence object @ring : ring index the fence is associated with Emits a fence command on the requested ring ( all asics ) . Returns 0 on success - ENOMEM on failure .
int radeon_fence_emit(struct radeon_device *rdev,
		      struct radeon_fence **fence,
		      int ring)
{
	*fence = malloc(sizeof(struct radeon_fence), DRM_MEM_DRIVER, M_NOWAIT);
	if ((*fence) == NULL) {
		return -ENOMEM;
	}
	refcount_init(&((*fence)->kref), 1);
	(*fence)->rdev = rdev;
	(*fence)->seq = ++rdev->fence_drv[ring].sync_seq[ring];
	(*fence)->ring = ring;
	radeon_fence_ring_emit(rdev, ring, *fence);
	CTR2(KTR_DRM, "radeon fence: emit (ring=%d, seq=%d)", ring, (*fence)->seq);
	return 0;
}
int radeon_fence_emit ( struct radeon_device * rdev , struct radeon_fence * * fence , int ring ) { * fence = malloc ( sizeof ( struct radeon_fence ) , DRM_MEM_DRIVER , M_NOWAIT ) ; if ( ( * fence ) == NULL ) { return - ENOMEM ; } refcount_init ( & ( ( * fence ) -> kref ) , 1 ) ; ( * fence ) -> rdev = rdev ; ( * fence ) -> seq = ++ rdev -> fence_drv [ ring ] . sync_seq [ ring ] ; ( * fence ) -> ring = ring ; radeon_fence_ring_emit ( rdev , ring , * fence ) ; CTR2 ( KTR_DRM , " " , ring , ( * fence ) -> seq ) ; return 0 ; }
radeon_fence_emit - emit a fence on the requested ring
 @rdev: radeon_device pointer
 @fence: radeon fence object
 @ring: ring index the fence is associated with
radeon_fence_emit - emit a fence on the requested ring @rdev : radeon_device pointer @fence : radeon fence object @ring : ring index the fence is associated with
/* we are protected by the ring emission mutex */