[PATCH] drm/i915: Flush GPU access to the old fence on i915

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 6 04:47:07 PST 2009


Not having access to the documentation for i915, I don't trust the GPU to
finish any pending access when changing the fence register.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3e01449..4d2607d 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1640,6 +1640,19 @@ try_again:
 			goto try_again;
 		}
 
+		if(!IS_I965G(dev)) {
+#if WATCH_FENCE
+			DRM_INFO("%s: waiting for gpu flush on fence %d (%p)\n",
+				 __func__, i, old_obj_priv);
+#endif
+			/* Flush pending fenced access on i915 */
+			i915_gem_object_flush_gpu_write_domain(reg->obj);
+			i915_gem_object_flush_gtt_write_domain(reg->obj);
+			ret = i915_gem_object_wait_rendering(reg->obj);
+			if (ret)
+				return ret;
+		}
+
 		/*
 		 * Zap this virtual mapping so we can set up a fence again
 		 * for this object next time we need it.
-- 
1.6.0.4


--=-jw+eGx1Z7Uv+RKG3jhJW--



More information about the Intel-gfx mailing list