Skip to content

Commit

Permalink
drm/i915: Move retire-requests into i915_gem_wait_for_idle()
Browse files Browse the repository at this point in the history
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: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170330145041.9005-3-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
  • Loading branch information
Chris Wilson committed Mar 31, 2017
1 parent b57f7f7 commit 72022a7
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
6 changes: 1 addition & 5 deletions drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -4179,10 +4179,6 @@ fault_irq_set(struct drm_i915_private *i915,
if (err)
goto err_unlock;

/* Retire to kick idle work */
i915_gem_retire_requests(i915);
GEM_BUG_ON(i915->gt.active_requests);

*irq = val;
mutex_unlock(&i915->drm.struct_mutex);

Expand Down Expand Up @@ -4286,7 +4282,7 @@ i915_drop_caches_set(void *data, u64 val)
goto unlock;
}

if (val & (DROP_RETIRE | DROP_ACTIVE))
if (val & DROP_RETIRE)
i915_gem_retire_requests(dev_priv);

lockdep_set_current_reclaim_state(GFP_KERNEL);
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3285,6 +3285,9 @@ int i915_gem_wait_for_idle(struct drm_i915_private *i915, unsigned int flags)
if (ret)
return ret;
}

i915_gem_retire_requests(i915);
GEM_BUG_ON(i915->gt.active_requests);
} else {
ret = wait_for_timeline(&i915->gt.global_timeline, flags);
if (ret)
Expand Down Expand Up @@ -4426,9 +4429,6 @@ int i915_gem_suspend(struct drm_i915_private *dev_priv)
if (ret)
goto err_unlock;

i915_gem_retire_requests(dev_priv);
GEM_BUG_ON(dev_priv->gt.active_requests);

assert_kernel_context_is_current(dev_priv);
i915_gem_context_lost(dev_priv);
mutex_unlock(&dev->struct_mutex);
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/i915/i915_gem_evict.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ i915_gem_evict_something(struct i915_address_space *vm,
if (ret)
return ret;

i915_gem_retire_requests(dev_priv);
goto search_again;

found:
Expand Down Expand Up @@ -383,7 +382,6 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle)
if (ret)
return ret;

i915_gem_retire_requests(dev_priv);
WARN_ON(!list_empty(&vm->active_list));
}

Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/i915/i915_gem_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ static int reset_all_global_seqno(struct drm_i915_private *i915, u32 seqno)
if (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 */
for_each_engine(engine, i915, id) {
struct intel_timeline *tl = &timeline->engine[id];
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/i915/selftests/i915_gem_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ static int begin_live_test(struct live_test *t,
return err;
}

i915_gem_retire_requests(i915);

i915->gpu_error.missed_irq_rings = 0;
t->reset_count = i915_reset_count(&i915->gpu_error);

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/selftests/intel_hangcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ static void hang_fini(struct hang *h)
i915_gem_object_put(h->hws);

i915_gem_wait_for_idle(h->i915, I915_WAIT_LOCKED);
i915_gem_retire_requests(h->i915);
}

static int igt_hang_sanitycheck(void *arg)
Expand Down

0 comments on commit 72022a7

Please sign in to comment.