Skip to content

Commit

Permalink
drm/i915: Set the context before setting up regs for the context.
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Eric Anholt authored and Daniel Vetter committed Jul 25, 2012
1 parent 35313cd commit 0da5cec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,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);
Expand All @@ -1249,10 +1253,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;
Expand Down

0 comments on commit 0da5cec

Please sign in to comment.