[Intel-gfx] [PATCH 2/2] drm/i915/gt: Pull engine w/a initialisation into common

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Jul 3 14:10:47 UTC 2019


On 03/07/2019 14:58, Chris Wilson wrote:
> We need to setup the workarounds on all engines, with the knowledge
> about which platforms each workaround applies to kept together in the
> workaround list. As such, we can pull the w/a initialisation into the
> common setup and try to avoid duplicating knowledge about when to setup
> the workarounds.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>   drivers/gpu/drm/i915/gem/i915_gem_context.c | 1 -
>   drivers/gpu/drm/i915/gt/intel_engine_cs.c   | 4 ++++
>   drivers/gpu/drm/i915/gt/intel_lrc.c         | 3 ---
>   drivers/gpu/drm/i915/gt/intel_workarounds.c | 2 +-
>   4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index 8a9787cf0cd0..e367dce2a696 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -657,7 +657,6 @@ int i915_gem_contexts_init(struct drm_i915_private *dev_priv)
>   	GEM_BUG_ON(dev_priv->kernel_context);
>   	GEM_BUG_ON(dev_priv->preempt_context);
>   
> -	intel_engine_init_ctx_wa(dev_priv->engine[RCS0]);
>   	init_contexts(dev_priv);
>   
>   	/* lowest priority; idle task */
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> index c1fb5fa3952e..25c037c8b551 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> @@ -636,6 +636,10 @@ static int intel_engine_setup_common(struct intel_engine_cs *engine)
>   	engine->sseu =
>   		intel_sseu_from_device_info(&RUNTIME_INFO(engine->i915)->sseu);
>   
> +	intel_engine_init_workarounds(engine);
> +	intel_engine_init_whitelist(engine);
> +	intel_engine_init_ctx_wa(engine);
> +
>   	return 0;
>   }
>   
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index 1e85e04c58c4..9ee323673e73 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -2806,9 +2806,6 @@ int intel_execlists_submission_init(struct intel_engine_cs *engine)
>   	if (ret)
>   		return ret;
>   
> -	intel_engine_init_workarounds(engine);
> -	intel_engine_init_whitelist(engine);
> -
>   	if (intel_init_workaround_bb(engine))
>   		/*
>   		 * We continue even if we fail to initialize WA batch
> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> index a908d829d6bd..d7da094170be 100644
> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> @@ -1364,7 +1364,7 @@ void intel_engine_init_workarounds(struct intel_engine_cs *engine)
>   {
>   	struct i915_wa_list *wal = &engine->wa_list;
>   
> -	if (GEM_WARN_ON(INTEL_GEN(engine->i915) < 8))
> +	if (INTEL_GEN(engine->i915) < 8)
>   		return;
>   
>   	wa_init_start(wal, engine->name);
> 

One less i915->engines[RCS0], good. :)

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the Intel-gfx mailing list