FreeBSD/sys/dev/drm2/radeon/radeon_fence.c
/**
 * radeon_fence_driver_fini - tear down the fence driver
 * for all possible rings.
 *
 * @rdev: radeon device pointer
 *
 * Tear down the fence driver for all possible rings (all asics).
 */
tear down the fence driver
for all possible rings.

@rdev: radeon device pointer

Tear down the fence driver for all possible rings (all asics).
tear down the fence driver for all possible rings . @rdev : radeon device pointer Tear down the fence driver for all possible rings ( all asics ) .
void radeon_fence_driver_fini(struct radeon_device *rdev)
{
	int ring, r;
	sx_xlock(&rdev->ring_lock);
	for (ring = 0; ring < RADEON_NUM_RINGS; ring++) {
		if (!rdev->fence_drv[ring].initialized)
			continue;
		r = radeon_fence_wait_empty_locked(rdev, ring);
		if (r) {
			radeon_fence_driver_force_completion(rdev);
		}
		cv_broadcast(&rdev->fence_queue);
		radeon_scratch_free(rdev, rdev->fence_drv[ring].scratch_reg);
		rdev->fence_drv[ring].initialized = false;
		cv_destroy(&rdev->fence_queue);
	}
	sx_xunlock(&rdev->ring_lock);
}
void radeon_fence_driver_fini ( struct radeon_device * rdev ) { int ring , r ; sx_xlock ( & rdev -> ring_lock ) ; for ( ring = 0 ; ring < RADEON_NUM_RINGS ; ring ++ ) { if ( ! rdev -> fence_drv [ ring ] . initialized ) continue ; r = radeon_fence_wait_empty_locked ( rdev , ring ) ; if ( r ) { radeon_fence_driver_force_completion ( rdev ) ; } cv_broadcast ( & rdev -> fence_queue ) ; radeon_scratch_free ( rdev , rdev -> fence_drv [ ring ] . scratch_reg ) ; rdev -> fence_drv [ ring ] . initialized = false ; cv_destroy ( & rdev -> fence_queue ) ; } sx_xunlock ( & rdev -> ring_lock ) ; }
radeon_fence_driver_fini - tear down the fence driver
 for all possible rings.
radeon_fence_driver_fini - tear down the fence driver for all possible rings .
/* no need to trigger GPU reset as we are unloading */