Commit 9bdc3573 authored by Michał Winiarski's avatar Michał Winiarski Committed by Chris Wilson

drm/i915/guc: Initialize GuC before restarting engines

Now that we're handling request resubmission the same way as regular
submission (from the tasklet), we can move GuC initialization earlier,
before restarting the engines. This way, we're no longer being in the
state of flux during engine restart - we're already in user requested
submission mode.
Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Oscar Mateo <oscar.mateo@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20171025172519.10670-5-chris@chris-wilson.co.ukSigned-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent bcbd5c33
...@@ -4926,6 +4926,11 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv) ...@@ -4926,6 +4926,11 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv)
goto out; goto out;
} }
/* We can't enable contexts until all firmware is loaded */
ret = intel_uc_init_hw(dev_priv);
if (ret)
goto out;
/* Need to do basic initialisation of all rings first: */ /* Need to do basic initialisation of all rings first: */
ret = __i915_gem_restart_engines(dev_priv); ret = __i915_gem_restart_engines(dev_priv);
if (ret) if (ret)
...@@ -4933,11 +4938,6 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv) ...@@ -4933,11 +4938,6 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv)
intel_mocs_init_l3cc_table(dev_priv); intel_mocs_init_l3cc_table(dev_priv);
/* We can't enable contexts until all firmware is loaded */
ret = intel_uc_init_hw(dev_priv);
if (ret)
goto out;
out: out:
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
return ret; return ret;
......
...@@ -1132,15 +1132,7 @@ int i915_guc_submission_enable(struct drm_i915_private *dev_priv) ...@@ -1132,15 +1132,7 @@ int i915_guc_submission_enable(struct drm_i915_private *dev_priv)
for_each_engine(engine, dev_priv, id) { for_each_engine(engine, dev_priv, id) {
struct intel_engine_execlists * const execlists = &engine->execlists; struct intel_engine_execlists * const execlists = &engine->execlists;
/* The tasklet was initialised by execlists, and may be in
* a state of flux (across a reset) and so we just want to
* take over the callback without changing any other state
* in the tasklet.
*/
execlists->irq_tasklet.func = i915_guc_irq_handler; execlists->irq_tasklet.func = i915_guc_irq_handler;
clear_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted);
tasklet_schedule(&execlists->irq_tasklet);
engine->park = i915_guc_submission_park; engine->park = i915_guc_submission_park;
engine->unpark = i915_guc_submission_unpark; engine->unpark = i915_guc_submission_unpark;
} }
......
...@@ -1474,7 +1474,7 @@ static int gen8_init_common_ring(struct intel_engine_cs *engine) ...@@ -1474,7 +1474,7 @@ static int gen8_init_common_ring(struct intel_engine_cs *engine)
execlists->active = 0; execlists->active = 0;
/* After a GPU reset, we may have requests to replay */ /* After a GPU reset, we may have requests to replay */
if (!i915_modparams.enable_guc_submission && execlists->first) if (execlists->first)
tasklet_schedule(&execlists->irq_tasklet); tasklet_schedule(&execlists->irq_tasklet);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment