Commit b8991403 authored by Oscar Mateo's avatar Oscar Mateo Committed by Joonas Lahtinen

drm/i915/guc: Take enable_guc_loading check out of GEM core code

The should happen as soon as possible, but always within the logic that
depends on it (and not interrupting the top-level driver control flow).

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: default avatarOscar Mateo <oscar.mateo@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1490720027-23234-1-git-send-email-oscar.mateo@intel.com
parent 2e5fec5f
...@@ -549,8 +549,7 @@ static const struct vga_switcheroo_client_ops i915_switcheroo_ops = { ...@@ -549,8 +549,7 @@ static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
static void i915_gem_fini(struct drm_i915_private *dev_priv) static void i915_gem_fini(struct drm_i915_private *dev_priv)
{ {
mutex_lock(&dev_priv->drm.struct_mutex); mutex_lock(&dev_priv->drm.struct_mutex);
if (i915.enable_guc_loading) intel_uc_fini_hw(dev_priv);
intel_uc_fini_hw(dev_priv);
i915_gem_cleanup_engines(dev_priv); i915_gem_cleanup_engines(dev_priv);
i915_gem_context_fini(dev_priv); i915_gem_context_fini(dev_priv);
mutex_unlock(&dev_priv->drm.struct_mutex); mutex_unlock(&dev_priv->drm.struct_mutex);
......
...@@ -4611,12 +4611,10 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv) ...@@ -4611,12 +4611,10 @@ 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);
if (i915.enable_guc_loading) { /* We can't enable contexts until all firmware is loaded */
/* We can't enable contexts until all firmware is loaded */ ret = intel_uc_init_hw(dev_priv);
ret = intel_uc_init_hw(dev_priv); if (ret)
if (ret) goto out;
goto out;
}
out: out:
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
......
...@@ -254,6 +254,9 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv) ...@@ -254,6 +254,9 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
{ {
int ret, attempts; int ret, attempts;
if (!i915.enable_guc_loading)
return 0;
gen9_reset_guc_interrupts(dev_priv); gen9_reset_guc_interrupts(dev_priv);
/* We need to notify the guc whenever we change the GGTT */ /* We need to notify the guc whenever we change the GGTT */
...@@ -343,6 +346,9 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv) ...@@ -343,6 +346,9 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
void intel_uc_fini_hw(struct drm_i915_private *dev_priv) void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
{ {
if (!i915.enable_guc_loading)
return;
if (i915.enable_guc_submission) { if (i915.enable_guc_submission) {
i915_guc_submission_disable(dev_priv); i915_guc_submission_disable(dev_priv);
gen9_disable_guc_interrupts(dev_priv); gen9_disable_guc_interrupts(dev_priv);
......
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