Commit a0de908d authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Chris Wilson

drm/i915: Reorder early initialization

In upcoming patch, we want to perform more actions in early
initialization of the uC. This reordering will help resolve
new dependencies that will be introduced by future patch.

v2: s/i915_gem_load_init/i915_gem_init_early (Chris)
v3: s/i915_gem_load_cleanup/i915_gem_cleanup_early (Michal)
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.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/20180323123451.59244-1-michal.wajdeczko@intel.com
parent 28e0e8ac
...@@ -919,17 +919,21 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv, ...@@ -919,17 +919,21 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
mutex_init(&dev_priv->wm.wm_mutex); mutex_init(&dev_priv->wm.wm_mutex);
mutex_init(&dev_priv->pps_mutex); mutex_init(&dev_priv->pps_mutex);
intel_wopcm_init_early(&dev_priv->wopcm);
intel_uc_init_early(dev_priv);
i915_memcpy_init_early(dev_priv); i915_memcpy_init_early(dev_priv);
ret = i915_workqueues_init(dev_priv); ret = i915_workqueues_init(dev_priv);
if (ret < 0) if (ret < 0)
goto err_engines; goto err_engines;
ret = i915_gem_init_early(dev_priv);
if (ret < 0)
goto err_workqueues;
/* This must be called before any calls to HAS_PCH_* */ /* This must be called before any calls to HAS_PCH_* */
intel_detect_pch(dev_priv); intel_detect_pch(dev_priv);
intel_wopcm_init_early(&dev_priv->wopcm);
intel_uc_init_early(dev_priv);
intel_pm_setup(dev_priv); intel_pm_setup(dev_priv);
intel_init_dpio(dev_priv); intel_init_dpio(dev_priv);
intel_power_domains_init(dev_priv); intel_power_domains_init(dev_priv);
...@@ -938,18 +942,13 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv, ...@@ -938,18 +942,13 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
intel_init_display_hooks(dev_priv); intel_init_display_hooks(dev_priv);
intel_init_clock_gating_hooks(dev_priv); intel_init_clock_gating_hooks(dev_priv);
intel_init_audio_hooks(dev_priv); intel_init_audio_hooks(dev_priv);
ret = i915_gem_load_init(dev_priv);
if (ret < 0)
goto err_irq;
intel_display_crc_init(dev_priv); intel_display_crc_init(dev_priv);
intel_detect_preproduction_hw(dev_priv); intel_detect_preproduction_hw(dev_priv);
return 0; return 0;
err_irq: err_workqueues:
intel_irq_fini(dev_priv);
i915_workqueues_cleanup(dev_priv); i915_workqueues_cleanup(dev_priv);
err_engines: err_engines:
i915_engines_cleanup(dev_priv); i915_engines_cleanup(dev_priv);
...@@ -962,8 +961,8 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv, ...@@ -962,8 +961,8 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
*/ */
static void i915_driver_cleanup_early(struct drm_i915_private *dev_priv) static void i915_driver_cleanup_early(struct drm_i915_private *dev_priv)
{ {
i915_gem_load_cleanup(dev_priv);
intel_irq_fini(dev_priv); intel_irq_fini(dev_priv);
i915_gem_cleanup_early(dev_priv);
i915_workqueues_cleanup(dev_priv); i915_workqueues_cleanup(dev_priv);
i915_engines_cleanup(dev_priv); i915_engines_cleanup(dev_priv);
} }
......
...@@ -2869,8 +2869,8 @@ int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, ...@@ -2869,8 +2869,8 @@ int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
int i915_gem_wait_ioctl(struct drm_device *dev, void *data, int i915_gem_wait_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv); struct drm_file *file_priv);
void i915_gem_sanitize(struct drm_i915_private *i915); void i915_gem_sanitize(struct drm_i915_private *i915);
int i915_gem_load_init(struct drm_i915_private *dev_priv); int i915_gem_init_early(struct drm_i915_private *dev_priv);
void i915_gem_load_cleanup(struct drm_i915_private *dev_priv); void i915_gem_cleanup_early(struct drm_i915_private *dev_priv);
void i915_gem_load_init_fences(struct drm_i915_private *dev_priv); void i915_gem_load_init_fences(struct drm_i915_private *dev_priv);
int i915_gem_freeze(struct drm_i915_private *dev_priv); int i915_gem_freeze(struct drm_i915_private *dev_priv);
int i915_gem_freeze_late(struct drm_i915_private *dev_priv); int i915_gem_freeze_late(struct drm_i915_private *dev_priv);
......
...@@ -5502,8 +5502,7 @@ static void i915_gem_init__mm(struct drm_i915_private *i915) ...@@ -5502,8 +5502,7 @@ static void i915_gem_init__mm(struct drm_i915_private *i915)
INIT_WORK(&i915->mm.free_work, __i915_gem_free_work); INIT_WORK(&i915->mm.free_work, __i915_gem_free_work);
} }
int int i915_gem_init_early(struct drm_i915_private *dev_priv)
i915_gem_load_init(struct drm_i915_private *dev_priv)
{ {
int err = -ENOMEM; int err = -ENOMEM;
...@@ -5578,7 +5577,7 @@ i915_gem_load_init(struct drm_i915_private *dev_priv) ...@@ -5578,7 +5577,7 @@ i915_gem_load_init(struct drm_i915_private *dev_priv)
return err; return err;
} }
void i915_gem_load_cleanup(struct drm_i915_private *dev_priv) void i915_gem_cleanup_early(struct drm_i915_private *dev_priv)
{ {
i915_gem_drain_freed_objects(dev_priv); i915_gem_drain_freed_objects(dev_priv);
GEM_BUG_ON(!llist_empty(&dev_priv->mm.free_list)); GEM_BUG_ON(!llist_empty(&dev_priv->mm.free_list));
......
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