drm/i915: Move retire-requests into i915_gem_wait_for_idle()
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 30 Mar 2017 14:50:38 +0000 (15:50 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 31 Mar 2017 11:03:46 +0000 (12:03 +0100)
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>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_evict.c
drivers/gpu/drm/i915/i915_gem_request.c
drivers/gpu/drm/i915/selftests/i915_gem_request.c
drivers/gpu/drm/i915/selftests/intel_hangcheck.c

index d4904245472f1a6f302d243238df0e71ddef136d..d689e511744e8f2fc9508e2d7345827c6a70bbb2 100644 (file)
@@ -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);
 
@@ -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);
index 7165f314f830422aa2b4ec9a58eb1cd001bf3f79..70bc72634a91c80b05801323ce570ab0e508d21c 100644 (file)
@@ -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)
@@ -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);
index 2da3a94fc9f391faf2b3ea4ae2b0f751b8643822..51e365f70464c8fcb0a4c8bdc70004f1b4627814 100644 (file)
@@ -196,7 +196,6 @@ search_again:
        if (ret)
                return ret;
 
-       i915_gem_retire_requests(dev_priv);
        goto search_again;
 
 found:
@@ -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));
        }
 
index b9d8f43b31e645a24e02a3915bb83bc5337c2ffd..f16900848650e2524f6b82221f524bcb0718c9c7 100644 (file)
@@ -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];
index 926b24c117d6a505be413b42ef44e961e1662277..6b788ffda822f2d9f24e9c33b76c91e72db3c749 100644 (file)
@@ -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);
 
index 6ec7c731a267a8e262361636b10da9970dacab24..aa31d6c0cdfb110a84f4d35fec1b3826e4fa4d89 100644 (file)
@@ -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)