Commit 72022a70 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Move retire-requests into i915_gem_wait_for_idle()

As we now distinguish everywhere that can call
i915_gem_retire_requests() following a successful wait_for_idle, we can
remove the duplication by moving that call into i915_gem_wait_for_idle()
itself.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170330145041.9005-3-chris@chris-wilson.co.ukReviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent b57f7f7d
...@@ -4179,10 +4179,6 @@ fault_irq_set(struct drm_i915_private *i915, ...@@ -4179,10 +4179,6 @@ fault_irq_set(struct drm_i915_private *i915,
if (err) if (err)
goto err_unlock; goto err_unlock;
/* Retire to kick idle work */
i915_gem_retire_requests(i915);
GEM_BUG_ON(i915->gt.active_requests);
*irq = val; *irq = val;
mutex_unlock(&i915->drm.struct_mutex); mutex_unlock(&i915->drm.struct_mutex);
...@@ -4286,7 +4282,7 @@ i915_drop_caches_set(void *data, u64 val) ...@@ -4286,7 +4282,7 @@ i915_drop_caches_set(void *data, u64 val)
goto unlock; goto unlock;
} }
if (val & (DROP_RETIRE | DROP_ACTIVE)) if (val & DROP_RETIRE)
i915_gem_retire_requests(dev_priv); i915_gem_retire_requests(dev_priv);
lockdep_set_current_reclaim_state(GFP_KERNEL); lockdep_set_current_reclaim_state(GFP_KERNEL);
......
...@@ -3285,6 +3285,9 @@ int i915_gem_wait_for_idle(struct drm_i915_private *i915, unsigned int flags) ...@@ -3285,6 +3285,9 @@ int i915_gem_wait_for_idle(struct drm_i915_private *i915, unsigned int flags)
if (ret) if (ret)
return ret; return ret;
} }
i915_gem_retire_requests(i915);
GEM_BUG_ON(i915->gt.active_requests);
} else { } else {
ret = wait_for_timeline(&i915->gt.global_timeline, flags); ret = wait_for_timeline(&i915->gt.global_timeline, flags);
if (ret) if (ret)
...@@ -4426,9 +4429,6 @@ int i915_gem_suspend(struct drm_i915_private *dev_priv) ...@@ -4426,9 +4429,6 @@ int i915_gem_suspend(struct drm_i915_private *dev_priv)
if (ret) if (ret)
goto err_unlock; goto err_unlock;
i915_gem_retire_requests(dev_priv);
GEM_BUG_ON(dev_priv->gt.active_requests);
assert_kernel_context_is_current(dev_priv); assert_kernel_context_is_current(dev_priv);
i915_gem_context_lost(dev_priv); i915_gem_context_lost(dev_priv);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
......
...@@ -196,7 +196,6 @@ i915_gem_evict_something(struct i915_address_space *vm, ...@@ -196,7 +196,6 @@ i915_gem_evict_something(struct i915_address_space *vm,
if (ret) if (ret)
return ret; return ret;
i915_gem_retire_requests(dev_priv);
goto search_again; goto search_again;
found: found:
...@@ -383,7 +382,6 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle) ...@@ -383,7 +382,6 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle)
if (ret) if (ret)
return ret; return ret;
i915_gem_retire_requests(dev_priv);
WARN_ON(!list_empty(&vm->active_list)); WARN_ON(!list_empty(&vm->active_list));
} }
......
...@@ -203,9 +203,6 @@ static int reset_all_global_seqno(struct drm_i915_private *i915, u32 seqno) ...@@ -203,9 +203,6 @@ static int reset_all_global_seqno(struct drm_i915_private *i915, u32 seqno)
if (ret) if (ret)
return ret; return ret;
i915_gem_retire_requests(i915);
GEM_BUG_ON(i915->gt.active_requests > 1);
/* If the seqno wraps around, we need to clear the breadcrumb rbtree */ /* If the seqno wraps around, we need to clear the breadcrumb rbtree */
for_each_engine(engine, i915, id) { for_each_engine(engine, i915, id) {
struct intel_timeline *tl = &timeline->engine[id]; struct intel_timeline *tl = &timeline->engine[id];
......
...@@ -291,8 +291,6 @@ static int begin_live_test(struct live_test *t, ...@@ -291,8 +291,6 @@ static int begin_live_test(struct live_test *t,
return err; return err;
} }
i915_gem_retire_requests(i915);
i915->gpu_error.missed_irq_rings = 0; i915->gpu_error.missed_irq_rings = 0;
t->reset_count = i915_reset_count(&i915->gpu_error); t->reset_count = i915_reset_count(&i915->gpu_error);
......
...@@ -235,7 +235,6 @@ static void hang_fini(struct hang *h) ...@@ -235,7 +235,6 @@ static void hang_fini(struct hang *h)
i915_gem_object_put(h->hws); i915_gem_object_put(h->hws);
i915_gem_wait_for_idle(h->i915, I915_WAIT_LOCKED); i915_gem_wait_for_idle(h->i915, I915_WAIT_LOCKED);
i915_gem_retire_requests(h->i915);
} }
static int igt_hang_sanitycheck(void *arg) static int igt_hang_sanitycheck(void *arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment