[Intel-gfx] [PATCH 19/46] drm/i915: Test request ordering between engines

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Thu Feb 9 10:20:21 UTC 2017


On to, 2017-02-02 at 09:08 +0000, Chris Wilson wrote:
> A request on one engine with a dependency on a request on another engine
> must wait for completion of the first request before starting.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> +static int live_sequential_engines(void *arg)
> +{

<SNIP>

> +	for_each_engine(engine, i915, id) {
> +		long timeout;
> +		u32 *cmd;
> +
> +		if (i915_gem_request_completed(request[id])) {
> +			pr_err("%s(%s): request completed too early!\n",
> +			       __func__, engine->name);
> +			err = -EINVAL;
> +			goto out_request;
> +		}

I was kinda anticipating you capture prev and always release the
previous batch, doesn't add that much value necessarily, but you could
make sure before releasing the batch that current has not even been
started yet. That's what you mention in the commit message.

> +
> +		cmd = i915_gem_object_pin_map(request[id]->batch->obj,
> +					      I915_MAP_WC);
> +		if (IS_ERR(cmd)) {
> +			err = PTR_ERR(cmd);
> +			pr_err("%s: failed to WC map batch, err=%d\n", __func__, err);
> +			goto out_request;
> +		}
> +		*cmd = MI_BATCH_BUFFER_END;
> +		wmb();
> +		i915_gem_object_unpin_map(request[id]->batch->obj);

recursive_batch_release()

With the helper;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list