drm/i915/gt: Pull engine w/a initialisation into common
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 Jul 2019 13:58:05 +0000 (14:58 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 4 Jul 2019 18:22:11 +0000 (19:22 +0100)
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@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190703135805.7310-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_context.c
drivers/gpu/drm/i915/gt/intel_engine_cs.c
drivers/gpu/drm/i915/gt/intel_lrc.c
drivers/gpu/drm/i915/gt/intel_workarounds.c

index 8a9787cf0cd05718b9625b992cf2f23d394f0848..e367dce2a696f6726943a23b4870aa7573028411 100644 (file)
@@ -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 */
index 7d6d6e62e9cc6f889a51aeea64aa8132f739e7a0..df5932f5f578d76c7082e3e4e6fdc00b355878ee 100644 (file)
@@ -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;
 }
 
index 15906a1bee7315ddd3c0673bb3724852e51d6dcf..e1ae1399c72bb739bdfb2f01fd3503c6b82c4ec9 100644 (file)
@@ -2807,9 +2807,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
index 8dd9105efad9e116f1b67d056ec714d7412bcac2..53fe1eb7c7bdf02afe8e4f09fdfb8c1d9f5791ad 100644 (file)
@@ -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);