]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Stop passing I915_WAIT_LOCKED to i915_request_wait()
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 18 Jun 2019 07:41:30 +0000 (08:41 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 19 Jun 2019 11:58:38 +0000 (12:58 +0100)
Since commit eb8d0f5af4ec ("drm/i915: Remove GPU reset dependence on
struct_mutex"), the I915_WAIT_LOCKED flags passed to i915_request_wait()
has been defunct. Now go ahead and remove it from all callers.

References: eb8d0f5af4ec ("drm/i915: Remove GPU reset dependence on struct_mutex")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618074153.16055-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
drivers/gpu/drm/i915/gt/intel_ringbuffer.c
drivers/gpu/drm/i915/gt/intel_workarounds.c
drivers/gpu/drm/i915/gt/selftest_hangcheck.c
drivers/gpu/drm/i915/gt/selftest_lrc.c
drivers/gpu/drm/i915/gt/selftest_workarounds.c
drivers/gpu/drm/i915/i915_active.h
drivers/gpu/drm/i915/i915_request.c
drivers/gpu/drm/i915/i915_trace.h
drivers/gpu/drm/i915/selftests/i915_request.c
drivers/gpu/drm/i915/selftests/i915_timeline.c

index 03ac5003abf1d2fd4bec566b43f001d4f305a82a..eaa2b16574c7fcdf169490969cf48c51f7b86f9a 100644 (file)
@@ -83,9 +83,7 @@ static int live_nop_switch(void *arg)
                        }
                        i915_request_add(rq);
                }
-               if (i915_request_wait(rq,
-                                     I915_WAIT_LOCKED,
-                                     HZ / 5) < 0) {
+               if (i915_request_wait(rq, 0, HZ / 5) < 0) {
                        pr_err("Failed to populated %d contexts\n", nctx);
                        i915_gem_set_wedged(i915);
                        err = -EIO;
@@ -128,9 +126,7 @@ static int live_nop_switch(void *arg)
 
                                i915_request_add(rq);
                        }
-                       if (i915_request_wait(rq,
-                                             I915_WAIT_LOCKED,
-                                             HZ / 5) < 0) {
+                       if (i915_request_wait(rq, 0, HZ / 5) < 0) {
                                pr_err("Switching between %ld contexts timed out\n",
                                       prime);
                                i915_gem_set_wedged(i915);
@@ -893,7 +889,7 @@ __read_slice_count(struct drm_i915_private *i915,
        if (spin)
                igt_spinner_end(spin);
 
-       ret = i915_request_wait(rq, I915_WAIT_LOCKED, MAX_SCHEDULE_TIMEOUT);
+       ret = i915_request_wait(rq, 0, MAX_SCHEDULE_TIMEOUT);
        i915_request_put(rq);
        if (ret < 0)
                return ret;
@@ -980,9 +976,7 @@ out:
                igt_spinner_end(spin);
 
        if ((flags & TEST_IDLE) && ret == 0) {
-               ret = i915_gem_wait_for_idle(i915,
-                                            I915_WAIT_LOCKED,
-                                            MAX_SCHEDULE_TIMEOUT);
+               ret = i915_gem_wait_for_idle(i915, 0, MAX_SCHEDULE_TIMEOUT);
                if (ret)
                        return ret;
 
index bd35ad202459706bc5210537b92589b4db771f79..c6023bc9452d0d90f8252d824d1492c07bc7022b 100644 (file)
@@ -1815,7 +1815,7 @@ static noinline int wait_for_space(struct intel_ring *ring, unsigned int bytes)
                return -ENOSPC;
 
        timeout = i915_request_wait(target,
-                                   I915_WAIT_INTERRUPTIBLE | I915_WAIT_LOCKED,
+                                   I915_WAIT_INTERRUPTIBLE,
                                    MAX_SCHEDULE_TIMEOUT);
        if (timeout < 0)
                return timeout;
index a4e221c87ded1273a94bfda290f282f4aa1aa929..686df92b48663b1bd4c74dd1a0401c9b87f3c7a6 100644 (file)
@@ -1435,7 +1435,7 @@ static int engine_wa_list_verify(struct intel_context *ce,
                goto err_vma;
 
        i915_request_add(rq);
-       if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0) {
+       if (i915_request_wait(rq, 0, HZ / 5) < 0) {
                err = -ETIME;
                goto err_vma;
        }
index b0b2998e56b809c35708f71ee9a56b638479ecfd..1ee4c923044fc3ccc536da555d08fad40d10e999 100644 (file)
@@ -339,8 +339,7 @@ static int igt_hang_sanitycheck(void *arg)
 
                timeout = 0;
                igt_wedge_on_timeout(&w, i915, HZ / 10 /* 100ms timeout*/)
-                       timeout = i915_request_wait(rq,
-                                                   I915_WAIT_LOCKED,
+                       timeout = i915_request_wait(rq, 0,
                                                    MAX_SCHEDULE_TIMEOUT);
                if (i915_reset_failed(i915))
                        timeout = -EIO;
@@ -1098,7 +1097,7 @@ static int igt_reset_wait(void *arg)
 
        reset_count = fake_hangcheck(i915, ALL_ENGINES);
 
-       timeout = i915_request_wait(rq, I915_WAIT_LOCKED, 10);
+       timeout = i915_request_wait(rq, 0, 10);
        if (timeout < 0) {
                pr_err("i915_request_wait failed on a stuck request: err=%ld\n",
                       timeout);
@@ -1666,9 +1665,7 @@ static int igt_atomic_reset_engine(struct intel_engine_cs *engine,
                struct igt_wedge_me w;
 
                igt_wedge_on_timeout(&w, i915, HZ / 20 /* 50ms timeout*/)
-                       i915_request_wait(rq,
-                                         I915_WAIT_LOCKED,
-                                         MAX_SCHEDULE_TIMEOUT);
+                       i915_request_wait(rq, 0, MAX_SCHEDULE_TIMEOUT);
                if (i915_reset_failed(i915))
                        err = -EIO;
        }
index d84d31e3da1926819de4085f9c66fd4d0a045640..401e8b5392974a77ffe5d84d21460c31864ce502 100644 (file)
@@ -192,7 +192,7 @@ static int live_busywait_preempt(void *arg)
                }
 
                /* Low priority request should be busywaiting now */
-               if (i915_request_wait(lo, I915_WAIT_LOCKED, 1) != -ETIME) {
+               if (i915_request_wait(lo, 0, 1) != -ETIME) {
                        pr_err("%s: Busywaiting request did not!\n",
                               engine->name);
                        err = -EIO;
@@ -220,7 +220,7 @@ static int live_busywait_preempt(void *arg)
                intel_ring_advance(hi, cs);
                i915_request_add(hi);
 
-               if (i915_request_wait(lo, I915_WAIT_LOCKED, HZ / 5) < 0) {
+               if (i915_request_wait(lo, 0, HZ / 5) < 0) {
                        struct drm_printer p = drm_info_printer(i915->drm.dev);
 
                        pr_err("%s: Failed to preempt semaphore busywait!\n",
@@ -739,7 +739,6 @@ static int live_suppress_wait_preempt(void *arg)
                        GEM_BUG_ON(!i915_request_started(rq[0]));
 
                        if (i915_request_wait(rq[depth],
-                                             I915_WAIT_LOCKED |
                                              I915_WAIT_PRIORITY,
                                              1) != -ETIME) {
                                pr_err("%s: Waiter depth:%d completed!\n",
@@ -841,7 +840,7 @@ static int live_chain_preempt(void *arg)
                         __func__, engine->name, ring_size);
 
                igt_spinner_end(&lo.spin);
-               if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 2) < 0) {
+               if (i915_request_wait(rq, 0, HZ / 2) < 0) {
                        pr_err("Timed out waiting to flush %s\n", engine->name);
                        goto err_wedged;
                }
@@ -882,7 +881,7 @@ static int live_chain_preempt(void *arg)
                        engine->schedule(rq, &attr);
 
                        igt_spinner_end(&hi.spin);
-                       if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0) {
+                       if (i915_request_wait(rq, 0, HZ / 5) < 0) {
                                struct drm_printer p =
                                        drm_info_printer(i915->drm.dev);
 
@@ -898,7 +897,7 @@ static int live_chain_preempt(void *arg)
                        if (IS_ERR(rq))
                                goto err_wedged;
                        i915_request_add(rq);
-                       if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0) {
+                       if (i915_request_wait(rq, 0, HZ / 5) < 0) {
                                struct drm_printer p =
                                        drm_info_printer(i915->drm.dev);
 
@@ -1396,9 +1395,7 @@ static int nop_virtual_engine(struct drm_i915_private *i915,
                }
 
                for (nc = 0; nc < nctx; nc++) {
-                       if (i915_request_wait(request[nc],
-                                             I915_WAIT_LOCKED,
-                                             HZ / 10) < 0) {
+                       if (i915_request_wait(request[nc], 0, HZ / 10) < 0) {
                                pr_err("%s(%s): wait for %llx:%lld timed out\n",
                                       __func__, ve[0]->engine->name,
                                       request[nc]->fence.context,
@@ -1545,7 +1542,7 @@ static int mask_virtual_engine(struct drm_i915_private *i915,
        }
 
        for (n = 0; n < nsibling; n++) {
-               if (i915_request_wait(request[n], I915_WAIT_LOCKED, HZ / 10) < 0) {
+               if (i915_request_wait(request[n], 0, HZ / 10) < 0) {
                        pr_err("%s(%s): wait for %llx:%lld timed out\n",
                               __func__, ve->engine->name,
                               request[n]->fence.context,
@@ -1720,9 +1717,7 @@ static int bond_virtual_engine(struct drm_i915_private *i915,
                }
                onstack_fence_fini(&fence);
 
-               if (i915_request_wait(rq[0],
-                                     I915_WAIT_LOCKED,
-                                     HZ / 10) < 0) {
+               if (i915_request_wait(rq[0], 0, HZ / 10) < 0) {
                        pr_err("Master request did not execute (on %s)!\n",
                               rq[0]->engine->name);
                        err = -EIO;
@@ -1730,8 +1725,7 @@ static int bond_virtual_engine(struct drm_i915_private *i915,
                }
 
                for (n = 0; n < nsibling; n++) {
-                       if (i915_request_wait(rq[n + 1],
-                                             I915_WAIT_LOCKED,
+                       if (i915_request_wait(rq[n + 1], 0,
                                              MAX_SCHEDULE_TIMEOUT) < 0) {
                                err = -EIO;
                                goto out;
index 5f2011f3a4a4683cb2bf8924a4c30be1f71f5722..9eaf030affd0f43db998da9d4445ca810e33ef2d 100644 (file)
@@ -567,7 +567,7 @@ err_request:
                if (err)
                        goto out_batch;
 
-               if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0) {
+               if (i915_request_wait(rq, 0, HZ / 5) < 0) {
                        pr_err("%s: Futzing %x timedout; cancelling test\n",
                               engine->name, reg);
                        i915_gem_set_wedged(ctx->i915);
@@ -769,7 +769,7 @@ static int read_whitelisted_registers(struct i915_gem_context *ctx,
 err_req:
        i915_request_add(rq);
 
-       if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0)
+       if (i915_request_wait(rq, 0, HZ / 5) < 0)
                err = -EIO;
 
        return err;
@@ -825,7 +825,7 @@ static int scrub_whitelisted_registers(struct i915_gem_context *ctx,
 
 err_request:
        i915_request_add(rq);
-       if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0)
+       if (i915_request_wait(rq, 0, HZ / 5) < 0)
                err = -EIO;
 
 err_unpin:
index d55d37673944895a48984bb88c6dcaa5d573a8d0..c14eebf6d07477756d4e6d5e97a3b3d53d935232 100644 (file)
@@ -330,7 +330,7 @@ i915_active_request_retire(struct i915_active_request *active,
                return 0;
 
        ret = i915_request_wait(request,
-                               I915_WAIT_INTERRUPTIBLE | I915_WAIT_LOCKED,
+                               I915_WAIT_INTERRUPTIBLE,
                                MAX_SCHEDULE_TIMEOUT);
        if (ret < 0)
                return ret;
index 0c2b53b8a3d1c7e450884f1d0ffad769b2b4822c..a195a92d0105199bb0d689bce1cfeedcd0acee19 100644 (file)
@@ -1360,10 +1360,6 @@ static void request_wait_wake(struct dma_fence *fence, struct dma_fence_cb *cb)
  * maximum of @timeout jiffies (with MAX_SCHEDULE_TIMEOUT implying an
  * unbounded wait).
  *
- * If the caller holds the struct_mutex, the caller must pass I915_WAIT_LOCKED
- * in via the flags, and vice versa if the struct_mutex is not held, the caller
- * must not specify that the wait is locked.
- *
  * Returns the remaining time (in jiffies) if the request completed, which may
  * be zero or -ETIME if the request is unfinished after the timeout expires.
  * May return -EINTR is called with I915_WAIT_INTERRUPTIBLE and a signal is
index 5c8cfaa70d723e67cd98721625dd7c53ec8f3936..f4ce643b3bc3ea00ff563979de1e112b2315dac0 100644 (file)
@@ -863,10 +863,9 @@ TRACE_EVENT(i915_request_wait_begin,
                           __entry->flags = flags;
                           ),
 
-           TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, blocking=%u, flags=0x%x",
+           TP_printk("dev=%u, engine=%u:%u, hw_id=%u, ctx=%llu, seqno=%u, flags=0x%x",
                      __entry->dev, __entry->class, __entry->instance,
                      __entry->hw_id, __entry->ctx, __entry->seqno,
-                     !!(__entry->flags & I915_WAIT_LOCKED),
                      __entry->flags)
 );
 
index 3de24f3d4ed5dc920c117da68c8402cc9b09ad46..298bb7116c5110ff285635fe6f8a89e9097a354c 100644 (file)
@@ -74,12 +74,12 @@ static int igt_wait_request(void *arg)
                goto out_unlock;
        }
 
-       if (i915_request_wait(request, I915_WAIT_LOCKED, 0) != -ETIME) {
+       if (i915_request_wait(request, 0, 0) != -ETIME) {
                pr_err("request wait (busy query) succeeded (expected timeout before submit!)\n");
                goto out_unlock;
        }
 
-       if (i915_request_wait(request, I915_WAIT_LOCKED, T) != -ETIME) {
+       if (i915_request_wait(request, 0, T) != -ETIME) {
                pr_err("request wait succeeded (expected timeout before submit!)\n");
                goto out_unlock;
        }
@@ -91,7 +91,7 @@ static int igt_wait_request(void *arg)
 
        i915_request_add(request);
 
-       if (i915_request_wait(request, I915_WAIT_LOCKED, 0) != -ETIME) {
+       if (i915_request_wait(request, 0, 0) != -ETIME) {
                pr_err("request wait (busy query) succeeded (expected timeout after submit!)\n");
                goto out_unlock;
        }
@@ -101,12 +101,12 @@ static int igt_wait_request(void *arg)
                goto out_unlock;
        }
 
-       if (i915_request_wait(request, I915_WAIT_LOCKED, T / 2) != -ETIME) {
+       if (i915_request_wait(request, 0, T / 2) != -ETIME) {
                pr_err("request wait succeeded (expected timeout!)\n");
                goto out_unlock;
        }
 
-       if (i915_request_wait(request, I915_WAIT_LOCKED, T) == -ETIME) {
+       if (i915_request_wait(request, 0, T) == -ETIME) {
                pr_err("request wait timed out!\n");
                goto out_unlock;
        }
@@ -116,7 +116,7 @@ static int igt_wait_request(void *arg)
                goto out_unlock;
        }
 
-       if (i915_request_wait(request, I915_WAIT_LOCKED, T) == -ETIME) {
+       if (i915_request_wait(request, 0, T) == -ETIME) {
                pr_err("request wait timed out when already complete!\n");
                goto out_unlock;
        }
@@ -574,9 +574,7 @@ static int live_nop_request(void *arg)
 
                                i915_request_add(request);
                        }
-                       i915_request_wait(request,
-                                         I915_WAIT_LOCKED,
-                                         MAX_SCHEDULE_TIMEOUT);
+                       i915_request_wait(request, 0, MAX_SCHEDULE_TIMEOUT);
 
                        times[1] = ktime_sub(ktime_get_raw(), times[1]);
                        if (prime == 1)
@@ -706,9 +704,7 @@ static int live_empty_request(void *arg)
                        err = PTR_ERR(request);
                        goto out_batch;
                }
-               i915_request_wait(request,
-                                 I915_WAIT_LOCKED,
-                                 MAX_SCHEDULE_TIMEOUT);
+               i915_request_wait(request, 0, MAX_SCHEDULE_TIMEOUT);
 
                for_each_prime_number_from(prime, 1, 8192) {
                        times[1] = ktime_get_raw();
@@ -720,9 +716,7 @@ static int live_empty_request(void *arg)
                                        goto out_batch;
                                }
                        }
-                       i915_request_wait(request,
-                                         I915_WAIT_LOCKED,
-                                         MAX_SCHEDULE_TIMEOUT);
+                       i915_request_wait(request, 0, MAX_SCHEDULE_TIMEOUT);
 
                        times[1] = ktime_sub(ktime_get_raw(), times[1]);
                        if (prime == 1)
@@ -895,8 +889,7 @@ static int live_all_engines(void *arg)
        for_each_engine(engine, i915, id) {
                long timeout;
 
-               timeout = i915_request_wait(request[id],
-                                           I915_WAIT_LOCKED,
+               timeout = i915_request_wait(request[id], 0,
                                            MAX_SCHEDULE_TIMEOUT);
                if (timeout < 0) {
                        err = timeout;
@@ -1013,8 +1006,7 @@ static int live_sequential_engines(void *arg)
                        goto out_request;
                }
 
-               timeout = i915_request_wait(request[id],
-                                           I915_WAIT_LOCKED,
+               timeout = i915_request_wait(request[id], 0,
                                            MAX_SCHEDULE_TIMEOUT);
                if (timeout < 0) {
                        err = timeout;
index 724bf3650b3e9a1901ef5c3c624843957f9cc2c7..76d3977f1d4b32e74e027079b1749fd7bf88ed84 100644 (file)
@@ -724,7 +724,7 @@ static int live_hwsp_wrap(void *arg)
 
                i915_request_add(rq);
 
-               if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0) {
+               if (i915_request_wait(rq, 0, HZ / 5) < 0) {
                        pr_err("Wait for timeline writes timed out!\n");
                        err = -EIO;
                        goto out;
@@ -797,9 +797,7 @@ static int live_hwsp_recycle(void *arg)
                                goto out;
                        }
 
-                       if (i915_request_wait(rq,
-                                             I915_WAIT_LOCKED,
-                                             HZ / 5) < 0) {
+                       if (i915_request_wait(rq, 0, HZ / 5) < 0) {
                                pr_err("Wait for timeline writes timed out!\n");
                                i915_timeline_put(tl);
                                err = -EIO;