[Intel-gfx] [PATCH v2] drm/i915: Skip cancelled requests in flight

Chris Wilson chris at chris-wilson.co.uk
Wed Mar 8 15:38:17 UTC 2017


On Wed, Mar 08, 2017 at 12:14:12PM +0000, Chris Wilson wrote:
>  static int __i915_sw_fence_call
>  submit_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
>  {
> @@ -486,7 +510,14 @@ submit_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
>  	switch (state) {
>  	case FENCE_COMPLETE:
>  		trace_i915_gem_request_submit(request);
> -		request->engine->submit_request(request);
> +		if (unlikely(fence->error == -EIO)) {

I'm not that keen on this error filtering. In the future, I expect
several critical errors (e.g. memory allocation failure whilst async
binding), but we also have non-critical ones like ETIMEDOUT or EAGAIN.

Maybe

if (unlikely(fence->error)) {
	if (critical_fence_error(fence->error))
		i915_gem_request_skip(request);
	dma_fence_set_error(&request->fence, fence->error);
}

static bool critical_fence_error(int err)
{
	switch (err) {
	default:
		MISSING_CASE(err);
	case -EIO:
	case -ENOMEM:
		return true;
	
	case -EAGAIN:
	case -ETIMEDOUT:
		return false;
	}
}

?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list