[Intel-gfx] [PATCH 04/15] drm/i915: only one interrupt per batchbuffer is not enough!

Daniel Vetter daniel.vetter at ffwll.ch
Thu Mar 11 16:58:49 CET 2010


Previously I thought that one interrupt per batchbuffer should be
enough. Now tedious benchmarking showed this to be wrong.

Therefore track whether any commands have been isssued with a future
seqno (like pipelined fencing changes or flushes). If this is the case
emit a request before issueing the batchbuffer.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 drivers/gpu/drm/i915/i915_drv.h |    5 +++++
 drivers/gpu/drm/i915/i915_gem.c |   13 ++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8f69a9c..9c147ab 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -564,6 +564,11 @@ typedef struct drm_i915_private {
 		uint32_t next_gem_seqno;
 
 		/**
+		 * Do we have some not yet emitted requests outstanding?
+		 */
+		int outstanding_lazy_request;
+
+		/**
 		 * Waiting sequence number, if any
 		 */
 		uint32_t waiting_gem_seqno;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4c84b87..f46f1df 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1490,6 +1490,8 @@ i915_gem_next_request_seqno(struct drm_device *dev)
 {
 	drm_i915_private_t *dev_priv = dev->dev_private;
 
+	dev_priv->mm.outstanding_lazy_request = 1;
+
 	return dev_priv->mm.next_gem_seqno;
 }
 
@@ -3549,7 +3551,7 @@ i915_dispatch_gem_execbuffer(struct drm_device *dev,
 			OUT_RING(MI_BATCH_BUFFER);
 			OUT_RING(exec_start | MI_BATCH_NON_SECURE);
 			OUT_RING(exec_start + exec_len - 4);
-			OUT_RING(0);
+			OUT_RING(MI_NOOP);
 			ADVANCE_LP_RING();
 		} else {
 			BEGIN_LP_RING(2);
@@ -3946,8 +3948,12 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 		i915_gem_flush(dev,
 			       dev->invalidate_domains,
 			       dev->flush_domains);
-		if (dev->flush_domains & I915_GEM_GPU_DOMAINS)
-			(void)i915_add_request(dev, file_priv, 0);
+	}
+
+	/* Dropping this regresses xrender preformance! */
+	if (dev_priv->mm.outstanding_lazy_request) {
+		i915_add_request(dev, file_priv);
+		dev_priv->mm.outstanding_lazy_request = 0;
 	}
 
 	for (i = 0; i < args->buffer_count; i++) {
@@ -4857,6 +4863,7 @@ i915_gem_load(struct drm_device *dev)
 	INIT_DELAYED_WORK(&dev_priv->mm.retire_work,
 			  i915_gem_retire_work_handler);
 	dev_priv->mm.next_gem_seqno = 1;
+	dev_priv->mm.outstanding_lazy_request = 0;
 
 	spin_lock(&shrink_list_lock);
 	list_add(&dev_priv->mm.shrink_list, &shrink_list);
-- 
1.6.6.1




More information about the Intel-gfx mailing list