[179/190] drm/i915: Skip MI_SET_CONTEXT for the same context
diff mbox

Message ID 1452510091-6833-38-git-send-email-chris@chris-wilson.co.uk
State New
Headers show

Commit Message

Chris Wilson Jan. 11, 2016, 11:01 a.m. UTC
Fixes regression from

commit 71b7e54f71b899db9f8def67a0e976969384e699
Author: Daniel Vetter <daniel.vetter@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@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Patch
diff mbox

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;
 }