[Intel-gfx] [PATCH v3 3/3] drm/i915/selftests: Exercise adding requests to a full GGTT
Chris Wilson
chris at chris-wilson.co.uk
Thu Oct 12 14:40:10 UTC 2017
Quoting Chris Wilson (2017-10-12 13:57:26)
> + count = 0;
> + mutex_lock(&i915->drm.struct_mutex);
> + onstack_fence_init(&fence);
> + do {
> + struct drm_i915_gem_request *rq;
> + struct i915_gem_context *ctx;
> +
> + ctx = live_context(i915, file);
> + if (!ctx)
> + break;
> +
> + igt_evict_ctl.fail_if_busy = true;
> + rq = i915_gem_request_alloc(engine, ctx);
> + igt_evict_ctl.fail_if_busy = false;
> +
> + if (IS_ERR(rq)) {
> + /* When full, fail_if_busy will trigger -EBUSY */
> + if (PTR_ERR(rq) != -EBUSY) {
> + pr_err("Unexpected error from request alloc (ctx hw id %u, on %s): %d\n",
> + ctx->hw_id, engine->name,
> + (int)PTR_ERR(rq));
> + err = PTR_ERR(rq);
> + }
> + break;
> + }
> +
> + /* Keep every request busy until we are full */
> + err = i915_sw_fence_await_sw_fence_gfp(&rq->submit,
> + &fence,
> + GFP_KERNEL);
> + if (err < 0)
> + break;
> +
> + i915_add_request(rq);
> + count++;
> + err = 0;
> + } while(!i915_sw_fence_done(&fence));
This should now just be
} while (1);
The only escape is when we hit EBUSY upon filling the GGTT.
-Chris
More information about the Intel-gfx
mailing list