/* Flushes the CPU write domain for the object if it's dirty.  */
static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj)
/* Flushes the CPU write domain for the object if it's dirty.  */
static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj)
{
	struct drm_device *dev = obj->dev;
	uint32_t old_write_domain;
	if (obj->write_domain != I915_GEM_DOMAIN_CPU)
		return;
	i915_gem_clflush_object(obj);
	drm_agp_chipset_flush(dev);
	old_write_domain = obj->write_domain;
	obj->write_domain = 0;
	trace_i915_gem_object_change_domain(obj,
					    obj->read_domains,
					    old_write_domain);
}