[Intel-gfx] [PATCH 01/18] drm/i915: Support asynchronous waits on struct fence from i915_gem_request

Chris Wilson chris at chris-wilson.co.uk
Mon Sep 19 11:26:13 UTC 2016


On Wed, Sep 14, 2016 at 10:37:18AM +0300, Joonas Lahtinen wrote:
> On ke, 2016-09-14 at 07:52 +0100, Chris Wilson wrote:
> > +	array = to_fence_array(fence);
> > +	for (i = 0; i < array->num_fences; i++) {
> > +		struct fence *child = array->fences[i];
> > +
> > +		if (fence_is_i915(child))
> > +			ret = i915_gem_request_await_request(req,
> > +							     to_request(child));
> > +		else
> > +			ret = i915_sw_fence_await_dma_fence(&req->submit,
> > +							    child, 10*HZ,
> > +							    GFP_KERNEL);
> 
> This chunk repeats from above, make it a small
> __i915_gem_request_await_fence function.

It's not a repeat. If it were, we could just recurse. Except we don't
know how deep the fence-array could go.

> > +		if (ret < 0)
> > +			return ret;
> 
> How about the failure case when we're half bound, no need to tear down?

We submit the partial request that doesn't execute anything more than
the context setup. The next request in the timeline with then inherit
the context setup from this request. Same rule as everything else
handling errors during request construction.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list