[Intel-gfx] [PATCH 13/13] drm/i915: Move the write seqno handling to move_to_active

Chris Wilson chris at chris-wilson.co.uk
Fri Jul 13 15:14:16 CEST 2012


This moves the open-coded handling  of the write seqno from the
execbuffer dispatch into the core logic alongside the read seqno
handling.

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

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f281c7b..c4cedb6 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1427,7 +1427,9 @@ i915_gem_object_move_to_active(struct drm_i915_gem_object *obj,
 	struct drm_device *dev = obj->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	BUG_ON(obj->base.write_domain & ~I915_GEM_GPU_DOMAINS);
 	BUG_ON(ring == NULL);
+
 	obj->ring = ring;
 
 	/* Add a reference if we're newly entering the active list. */
@@ -1442,6 +1444,13 @@ i915_gem_object_move_to_active(struct drm_i915_gem_object *obj,
 
 	obj->last_read_seqno = seqno;
 
+	if (obj->base.write_domain) {
+		obj->dirty = 1;
+		obj->last_write_seqno = seqno;
+		if (obj->pin_count) /* check for potential scanout */
+			intel_mark_busy(dev, obj);
+	}
+
 	if (obj->fenced_gpu_access) {
 		obj->last_fenced_seqno = seqno;
 
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index b0a855f..c79191b 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -408,7 +408,6 @@ static int do_switch(struct i915_hw_context *to)
 		from_obj->base.write_domain = I915_GEM_DOMAIN_INSTRUCTION;
 		from_obj->base.read_domains = I915_GEM_DOMAIN_INSTRUCTION;
 		i915_gem_object_move_to_active(from_obj, to->ring, seqno);
-		from_obj->dirty = 1;
 		BUG_ON(from_obj->ring != to->ring);
 		i915_gem_object_unpin(from_obj);
 		drm_gem_object_unreference(&from_obj->base);
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index d48fe33..44f5b22 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -721,12 +721,6 @@ i915_gem_execbuffer_move_to_active(struct list_head *objects,
 		obj->fenced_gpu_access = obj->pending_fenced_gpu_access;
 
 		i915_gem_object_move_to_active(obj, ring, seqno);
-		if (obj->base.write_domain) {
-			obj->dirty = 1;
-			obj->last_write_seqno = seqno;
-			if (obj->pin_count) /* check for potential scanout */
-				intel_mark_busy(ring->dev, obj);
-		}
 
 		trace_i915_gem_object_change_domain(obj, old_read, old_write);
 	}
-- 
1.7.10.4




More information about the Intel-gfx mailing list