[Intel-gfx] [PATCH] drm/i915: Perform a flush on throttle.

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 11 15:26:43 CET 2009


Add a flush on every throttle to ensure that the output is written at
least once every frame. The reason for performing the flush in the
kernel is to take advantage of the amalgamation of pending flushes,
and saves allocation, by the application, of a batch buffer simply to
emit a MI_FLUSH.

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

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 40bfbe9..cece254 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2461,8 +2461,11 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file_priv)
 
 	mutex_lock(&dev->struct_mutex);
 	seqno = i915_file_priv->mm.last_gem_throttle_seqno;
-	i915_file_priv->mm.last_gem_throttle_seqno =
-		i915_file_priv->mm.last_gem_seqno;
+	if (i915_file_priv->mm.last_gem_seqno > seqno) {
+		i915_gem_flush(dev, I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS);
+		i915_file_priv->mm.last_gem_throttle_seqno =
+			i915_add_request(dev, I915_GEM_GPU_DOMAINS);
+	}
 	if (seqno)
 		ret = i915_wait_request(dev, seqno);
 	mutex_unlock(&dev->struct_mutex);
-- 
1.6.0.4




More information about the Intel-gfx mailing list