[Intel-gfx] [PATCH] drm/i915: Add engine idle check for CI

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 10 14:32:11 UTC 2017


On Fri, Feb 10, 2017 at 04:11:44PM +0200, Mika Kuoppala wrote:
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -347,9 +347,11 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
>  	u64 desc[2];
>  
>  	GEM_BUG_ON(port[0].count > 1);
> -	if (!port[0].count)
> +	if (!port[0].count) {
> +		GEM_BUG_ON(!intel_engine_idle(engine));

Hmm, I actually think i915_gem_mark_busy() is a better starting point
for the BUG_ON. Here it looks slightly incongruous.

>  		execlists_context_status_change(port[0].request,
>  						INTEL_CONTEXT_SCHEDULE_IN);
> +	}
>  	desc[0] = execlists_update_context(port[0].request);
>  	GEM_BUG_ONLY(port[0].context_id = upper_32_bits(desc[0]));
>  	port[0].count++;
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index 896838c..a319df9 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -603,6 +603,7 @@ bool intel_engine_add_wait(struct intel_engine_cs *engine,
>  void intel_engine_remove_wait(struct intel_engine_cs *engine,
>  			      struct intel_wait *wait);
>  void intel_engine_enable_signaling(struct drm_i915_gem_request *request);
> +bool intel_engine_idle(struct intel_engine_cs *engine);

intel_engine_is_idle()

idle can be construed as a verb (and we have used it as such in the
past, e.g. i915_gpu_idle()), so let's be careful.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list