Commit b0258bf2 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin Committed by Chris Wilson

drm/i915: Pass intel_gt to intel_engines_cleanup

Engines belong to the GT so make it indicative in the API.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191022094726.3001-4-tvrtko.ursulin@linux.intel.com
parent 3ea951c6
...@@ -327,7 +327,7 @@ __intel_ring_space(unsigned int head, unsigned int tail, unsigned int size) ...@@ -327,7 +327,7 @@ __intel_ring_space(unsigned int head, unsigned int tail, unsigned int size)
int intel_engines_init_mmio(struct intel_gt *gt); int intel_engines_init_mmio(struct intel_gt *gt);
int intel_engines_setup(struct drm_i915_private *i915); int intel_engines_setup(struct drm_i915_private *i915);
int intel_engines_init(struct drm_i915_private *i915); int intel_engines_init(struct drm_i915_private *i915);
void intel_engines_cleanup(struct drm_i915_private *i915); void intel_engines_cleanup(struct intel_gt *gt);
int intel_engine_init_common(struct intel_engine_cs *engine); int intel_engine_init_common(struct intel_engine_cs *engine);
void intel_engine_cleanup_common(struct intel_engine_cs *engine); void intel_engine_cleanup_common(struct intel_engine_cs *engine);
......
...@@ -381,16 +381,17 @@ static void intel_setup_engine_capabilities(struct intel_gt *gt) ...@@ -381,16 +381,17 @@ static void intel_setup_engine_capabilities(struct intel_gt *gt)
/** /**
* intel_engines_cleanup() - free the resources allocated for Command Streamers * intel_engines_cleanup() - free the resources allocated for Command Streamers
* @i915: the i915 devic * @gt: pointer to struct intel_gt
*/ */
void intel_engines_cleanup(struct drm_i915_private *i915) void intel_engines_cleanup(struct intel_gt *gt)
{ {
struct intel_engine_cs *engine; struct intel_engine_cs *engine;
enum intel_engine_id id; enum intel_engine_id id;
for_each_engine(engine, i915, id) { for_each_engine(engine, gt, id) {
engine->destroy(engine); engine->destroy(engine);
i915->engine[id] = NULL; gt->engine[id] = NULL;
gt->i915->engine[id] = NULL;
} }
} }
...@@ -444,7 +445,7 @@ int intel_engines_init_mmio(struct intel_gt *gt) ...@@ -444,7 +445,7 @@ int intel_engines_init_mmio(struct intel_gt *gt)
return 0; return 0;
cleanup: cleanup:
intel_engines_cleanup(i915); intel_engines_cleanup(gt);
return err; return err;
} }
...@@ -475,7 +476,7 @@ int intel_engines_init(struct drm_i915_private *i915) ...@@ -475,7 +476,7 @@ int intel_engines_init(struct drm_i915_private *i915)
return 0; return 0;
cleanup: cleanup:
intel_engines_cleanup(i915); intel_engines_cleanup(&i915->gt);
return err; return err;
} }
...@@ -659,7 +660,7 @@ int intel_engines_setup(struct drm_i915_private *i915) ...@@ -659,7 +660,7 @@ int intel_engines_setup(struct drm_i915_private *i915)
return 0; return 0;
cleanup: cleanup:
intel_engines_cleanup(i915); intel_engines_cleanup(&i915->gt);
return err; return err;
} }
......
...@@ -621,7 +621,7 @@ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv) ...@@ -621,7 +621,7 @@ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv)
*/ */
static void i915_driver_mmio_release(struct drm_i915_private *dev_priv) static void i915_driver_mmio_release(struct drm_i915_private *dev_priv)
{ {
intel_engines_cleanup(dev_priv); intel_engines_cleanup(&dev_priv->gt);
intel_teardown_mchbar(dev_priv); intel_teardown_mchbar(dev_priv);
intel_uncore_fini_mmio(&dev_priv->uncore); intel_uncore_fini_mmio(&dev_priv->uncore);
pci_dev_put(dev_priv->bridge_dev); pci_dev_put(dev_priv->bridge_dev);
......
...@@ -1328,7 +1328,7 @@ int i915_gem_init(struct drm_i915_private *dev_priv) ...@@ -1328,7 +1328,7 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
err_uc_init: err_uc_init:
if (ret != -EIO) { if (ret != -EIO) {
intel_uc_fini(&dev_priv->gt.uc); intel_uc_fini(&dev_priv->gt.uc);
intel_engines_cleanup(dev_priv); intel_engines_cleanup(&dev_priv->gt);
} }
err_context: err_context:
if (ret != -EIO) if (ret != -EIO)
...@@ -1397,7 +1397,7 @@ void i915_gem_driver_remove(struct drm_i915_private *dev_priv) ...@@ -1397,7 +1397,7 @@ void i915_gem_driver_remove(struct drm_i915_private *dev_priv)
void i915_gem_driver_release(struct drm_i915_private *dev_priv) void i915_gem_driver_release(struct drm_i915_private *dev_priv)
{ {
intel_engines_cleanup(dev_priv); intel_engines_cleanup(&dev_priv->gt);
i915_gem_driver_release__contexts(dev_priv); i915_gem_driver_release__contexts(dev_priv);
intel_gt_driver_release(&dev_priv->gt); intel_gt_driver_release(&dev_priv->gt);
......
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