/* Ensures that all commands in the ring are finished before signalling the CPU  */
static uint32_t i915_retire_commands(struct drm_device *dev)
/* Ensures that all commands in the ring are finished before signalling the CPU  */
static uint32_t i915_retire_commands(struct drm_device *dev)
{
	drm_i915_private_t *dev_priv = dev->dev_private;
	uint32_t cmd = MI_FLUSH | MI_NO_WRITE_FLUSH;
	uint32_t flush_domains = 0;
	RING_LOCALS;
	if (IS_I965G(dev))
		flush_domains |= I915_GEM_DOMAIN_SAMPLER;
	BEGIN_LP_RING(2);
	OUT_RING(cmd);
	OUT_RING(0);
	ADVANCE_LP_RING();
	return flush_domains;
}