[Intel-gfx] [PATCH 07/15] drm/i915/gtt: call chipset flush directly

Daniel Vetter daniel.vetter at ffwll.ch
Sat Nov 6 15:22:00 CET 2010


Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 drivers/char/agp/intel-gtt.c    |    7 +++++++
 drivers/gpu/drm/i915/i915_gem.c |    9 ++++-----
 include/drm/intel-gtt.h         |    2 +-
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 0fca1b7..853128a 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -1513,6 +1513,13 @@ struct intel_gtt *intel_gtt_get(void)
 }
 EXPORT_SYMBOL(intel_gtt_get);
 
+void intel_gtt_chipset_flush(void)
+{
+	if (intel_private.driver->chipset_flush)
+		intel_private.driver->chipset_flush();
+}
+EXPORT_SYMBOL(intel_gtt_chipset_flush);
+
 void intel_gmch_remove(struct pci_dev *pdev)
 {
 	if (intel_private.pcidev)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 6f1cbff..49e38ff 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2168,7 +2168,7 @@ i915_gem_flush(struct drm_device *dev,
 	drm_i915_private_t *dev_priv = dev->dev_private;
 
 	if (flush_domains & I915_GEM_DOMAIN_CPU)
-		drm_agp_chipset_flush(dev);
+		intel_gtt_chipset_flush();
 
 	if ((flush_domains | invalidate_domains) & I915_GEM_GPU_DOMAINS) {
 		if (flush_rings & RING_RENDER)
@@ -2894,14 +2894,13 @@ i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj)
 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);
+	intel_gtt_chipset_flush();
 	old_write_domain = obj->write_domain;
 	obj->write_domain = 0;
 
@@ -4897,7 +4896,7 @@ void i915_gem_detach_phys_object(struct drm_device *dev,
 			page_cache_release(page);
 		}
 	}
-	drm_agp_chipset_flush(dev);
+	intel_gtt_chipset_flush();
 
 	obj_priv->phys_obj->cur_obj = NULL;
 	obj_priv->phys_obj = NULL;
@@ -4982,7 +4981,7 @@ i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
 	if (ret)
 		return -EFAULT;
 
-	drm_agp_chipset_flush(dev);
+	intel_gtt_chipset_flush();
 	return 0;
 }
 
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h
index 141fbfe..80cbf1f 100644
--- a/include/drm/intel-gtt.h
+++ b/include/drm/intel-gtt.h
@@ -13,7 +13,7 @@ struct intel_gtt {
 };
 
 struct intel_gtt *intel_gtt_get(void);
-
+void intel_gtt_chipset_flush(void);
 
 /* Special gtt memory types */
 #define AGP_DCACHE_MEMORY	1
-- 
1.7.1




More information about the Intel-gfx mailing list