[Intel-gfx] [PATCH 04/14] drm/i915: Inline __i915_gem_request_wait_for_execute()

Chris Wilson chris at chris-wilson.co.uk
Tue Feb 14 11:55:41 UTC 2017


On Tue, Feb 14, 2017 at 01:32:37PM +0200, Joonas Lahtinen wrote:
> On to, 2017-02-02 at 15:13 +0000, Chris Wilson wrote:
> > It had only one callsite and existed to keep the code clearer. Now
> > having shared the wait-on-error between phases and with plans to change
> > the wait-for-execute in the next few patches, remove the out of line
> > wait loop and move it into the main body of i915_wait_request.
> > 
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> 
> <SNIP>
> 
> > @@ -1080,7 +1037,30 @@ long i915_wait_request(struct drm_i915_gem_request *req,
> >  		add_wait_queue(errq, &reset);
> >  
> >  	if (!i915_sw_fence_done(&req->execute)) {
> > -		timeout = __i915_request_wait_for_execute(req, flags, timeout);
> > +		DEFINE_WAIT(exec);
> > +
> > +		do {
> > +			prepare_to_wait(&req->execute.wait, &exec, state);
> > +			if (i915_sw_fence_done(&req->execute))
> > +				break;
> > +
> > +			if (flags & I915_WAIT_LOCKED &&
> > +			    i915_reset_in_progress(&req->i915->gpu_error)) {
> > +				__set_current_state(TASK_RUNNING);
> > +				i915_reset(req->i915);
> 
> I'm no the expert here, but this reads funnily; "if reset in progress,
> do reset".

In a series-to-come, this is renamed to

	if (i915_reset_handoff())
		i915_reset();

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list