Skip to contentSkip to conversation

drm/i915: Set the context before setting up regs for the context.

PATCH Applied Eric Anholt 2 participants 2 messages Jul 23, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Set the context before setting up regs for the context.

Fixes failures in transform feedback on gen7 because our SOL_RESET flag was setting the transform feedback offsets in the old context (occasionally happened to be ours) instead of the new context.

---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_gem_execbuffer.c +4 -4
index e0489aa..25b2c54 100644
@@ -1030,6 +1030,10 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 		}
 	}
 
+	ret = i915_switch_context(ring, file, ctx_id);
+	if (ret)
+		goto err;
+
 	if (ring == &dev_priv->ring[RCS] &&
 	    mode != dev_priv->relative_constants_mode) {
 		ret = intel_ring_begin(ring, 4);
@@ -1051,10 +1055,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 			goto err;
 	}
 
-	ret = i915_switch_context(ring, file, ctx_id);
-	if (ret)
-		goto err;
-
 	trace_i915_gem_ring_dispatch(ring, seqno);
 
 	exec_start = batch_obj->gtt_offset + args->batch_start_offset;
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 5 lines · Eric Anholt

Fixes failures in transform feedback on gen7 because our SOL_RESET flag was setting the transform feedback offsets in the old context (occasionally happened to be ours) instead of the new context.

Picked up for -fixes, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48