[Intel-gfx] [PATCH 179/190] drm/i915: Skip MI_SET_CONTEXT for the same context

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 11 03:01:20 PST 2016


Fixes regression from

commit 71b7e54f71b899db9f8def67a0e976969384e699
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Tue Apr 14 17:35:18 2015 +0200

    drm/i915: Don't look at pg_dirty_rings for aliasing ppgtt

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 0c4864eca5f6..060e902afd1c 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -680,7 +680,7 @@ mi_set_context(struct drm_i915_gem_request *req, u32 hw_flags)
 
 	intel_ring_advance(ring);
 
-	return ret;
+	return 0;
 }
 
 static inline bool should_skip_switch(struct intel_engine_cs *ring,
@@ -690,9 +690,13 @@ static inline bool should_skip_switch(struct intel_engine_cs *ring,
 	if (to->remap_slice)
 		return false;
 
-	if (to->ppgtt && from == to &&
-	    !(intel_engine_flag(ring) & to->ppgtt->pd_dirty_rings))
-		return true;
+	if (from == to) {
+		if (to->ppgtt == NULL)
+			return true;
+
+		if (!(intel_engine_flag(ring) & to->ppgtt->pd_dirty_rings))
+			return true;
+	}
 
 	return false;
 }
-- 
2.7.0.rc3



More information about the Intel-gfx mailing list