aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Mateo <oscar.mateo@intel.com>2014-06-18 12:16:03 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-18 15:42:42 -0400
commit14d8ec544f2351a5da33e233b75f44cf6a5bea8e (patch)
tree87c523cb61253325d0769e23bf880109342efd1d
parent5d0cf3d6e07957502dae8602e2f96eb6790ddc13 (diff)
drm/i915: Remove ctx->last_ring
The original comment that introduced it said: commit 0009e46cd54324c4af20b0b52b89973b1b914167 Author: Ben Widawsky <ben@bwidawsk.net> Date: Fri Dec 6 14:11:02 2013 -0800 drm/i915: Track which ring a context ran on Previously we dropped the association of a context to a ring. It is however very important to know which ring a context ran on (we could have reused the other member, but I was nitpicky). This is very important when we switch address spaces, which unlike context objects, do change per ring. As an example, if we have: RCS BCS ctx A ctx A ctx B ctx B Without tracking the last ring B ran on, we wouldn't know to switch the address space on BCS in the last row. But this is not really true, because we are already checking to != from (with "from" being = ring->last_context) and that should be enough to make sure we switch to the right address space. We would have a problem if we switched the context object for every ring (since then we would fail to do it in some situations) but we only switch it for the render ring, so we don't care. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c3
2 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0640071e30a9..4fea8a07a85e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -591,7 +591,6 @@ struct intel_context {
591 bool is_initialized; 591 bool is_initialized;
592 uint8_t remap_slice; 592 uint8_t remap_slice;
593 struct drm_i915_file_private *file_priv; 593 struct drm_i915_file_private *file_priv;
594 struct intel_engine_cs *last_ring;
595 struct drm_i915_gem_object *obj; 594 struct drm_i915_gem_object *obj;
596 struct i915_ctx_hang_stats hang_stats; 595 struct i915_ctx_hang_stats hang_stats;
597 struct i915_address_space *vm; 596 struct i915_address_space *vm;
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 3ffe308d5893..21eda88ff541 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -605,7 +605,7 @@ static int do_switch(struct intel_engine_cs *ring,
605 BUG_ON(!i915_gem_obj_is_pinned(from->obj)); 605 BUG_ON(!i915_gem_obj_is_pinned(from->obj));
606 } 606 }
607 607
608 if (from == to && from->last_ring == ring && !to->remap_slice) 608 if (from == to && !to->remap_slice)
609 return 0; 609 return 0;
610 610
611 /* Trying to pin first makes error handling easier. */ 611 /* Trying to pin first makes error handling easier. */
@@ -699,7 +699,6 @@ static int do_switch(struct intel_engine_cs *ring,
699done: 699done:
700 i915_gem_context_reference(to); 700 i915_gem_context_reference(to);
701 ring->last_context = to; 701 ring->last_context = to;
702 to->last_ring = ring;
703 702
704 if (ring->id == RCS && !to->is_initialized && from == NULL) { 703 if (ring->id == RCS && !to->is_initialized && from == NULL) {
705 ret = i915_gem_render_state_init(ring); 704 ret = i915_gem_render_state_init(ring);