sys/dev/drm/i915/i915_gem_execbuffer.c
/**
 * Find one BSD ring to dispatch the corresponding BSD command.
 * The ring index is returned.
 */
Find one BSD ring to dispatch the corresponding BSD command.
The ring index is returned.
Find one BSD ring to dispatch the corresponding BSD command . The ring index is returned .
static unsigned int
gen8_dispatch_bsd_ring(struct drm_i915_private *dev_priv, struct drm_file *file)
{
	struct drm_i915_file_private *file_priv = file->driver_priv;
	if ((int)file_priv->bsd_ring < 0) {
		mutex_lock(&dev_priv->dev->struct_mutex);
		file_priv->bsd_ring = dev_priv->mm.bsd_ring_dispatch_index;
		dev_priv->mm.bsd_ring_dispatch_index ^= 1;
		mutex_unlock(&dev_priv->dev->struct_mutex);
	}
	return file_priv->bsd_ring;
}
static unsigned int gen8_dispatch_bsd_ring ( struct drm_i915_private * dev_priv , struct drm_file * file ) { struct drm_i915_file_private * file_priv = file -> driver_priv ; if ( ( int ) file_priv -> bsd_ring < 0 ) { mutex_lock ( & dev_priv -> dev -> struct_mutex ) ; file_priv -> bsd_ring = dev_priv -> mm . bsd_ring_dispatch_index ; dev_priv -> mm . bsd_ring_dispatch_index ^= 1 ; mutex_unlock ( & dev_priv -> dev -> struct_mutex ) ; } return file_priv -> bsd_ring ; }
Find one BSD ring to dispatch the corresponding BSD command.
Find one BSD ring to dispatch the corresponding BSD command .
/* Check whether the file_priv has already selected one ring. */ /* If not, use the ping-pong mechanism to select one. */