[PATCH 3/9] drm/i915: Add gen5 support to mi_set_context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Widawsky <ben@xxxxxxxxxxxx>

It's similar enough to the other gens that we don't really need a
distinct function to do it.

NOTE: The new function removes the MI_FLUSH that was at the end of the
old Ironlake switching code. Recent docs can find neither the
requirement for the MI_FLUSH or the MI_SUSPEND_FLUSH. Since I remember
clearly seeing the latter in a doc at one point however, I am going to
leave it there.

NOTE2: Remember to put NOTE1 in the commit where we start using the new
function for ILK.

CC: Kenneth Graunke <kenneth@xxxxxxxxxxxxx>
Signed-off-by: Ben Widawsky <ben@xxxxxxxxxxxx>
Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Tested-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> # X still works!
---
 drivers/gpu/drm/i915/i915_gem_context.c |   25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 82106c1..3a677ac 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -362,11 +362,18 @@ mi_set_context(struct intel_ring_buffer *ring,
 	if (ret)
 		return ret;
 
-	/* WaProgramMiArbOnOffAroundMiSetContext:ivb,vlv,hsw */
-	if (IS_GEN7(ring->dev))
+	switch (INTEL_INFO(ring->dev)->gen) {
+	case 7:
+		/* WaProgramMiArbOnOffAroundMiSetContext:ivb,vlv,hsw */
 		intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_DISABLE);
-	else
+		break;
+	case 5:
+		intel_ring_emit(ring, MI_SUSPEND_FLUSH | MI_SUSPEND_FLUSH_EN);
+		break;
+	default:
 		intel_ring_emit(ring, MI_NOOP);
+		break;
+	}
 
 	intel_ring_emit(ring, MI_NOOP);
 	intel_ring_emit(ring, MI_SET_CONTEXT);
@@ -378,14 +385,22 @@ mi_set_context(struct intel_ring_buffer *ring,
 	/* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP */
 	intel_ring_emit(ring, MI_NOOP);
 
-	if (IS_GEN7(ring->dev))
+	switch (INTEL_INFO(ring->dev)->gen) {
+	case 7:
 		intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_ENABLE);
-	else
+		break;
+	case 5:
+		intel_ring_emit(ring, MI_SUSPEND_FLUSH);
+		break;
+	default:
 		intel_ring_emit(ring, MI_NOOP);
+		break;
+	}
 
 	intel_ring_advance(ring);
 
 	return ret;
+
 }
 
 static int do_switch(struct i915_hw_context *to)
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux