]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Move i915_gem_fini to i915_gem.c
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 4 Jun 2018 09:00:32 +0000 (09:00 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 4 Jun 2018 14:00:01 +0000 (15:00 +0100)
We should keep i915_gem_init/fini functions together for easier
tracking of their symmetry.

v2: rebased, pulled out from the series

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180604090032.20840-1-michal.wajdeczko@intel.com
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c

index 915758a65c96fc01caac961606e769dffa6d18c7..83ce9c1ec170ac857d3aeda1aeca7a3627d3bdf3 100644 (file)
@@ -636,28 +636,6 @@ static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
        .can_switch = i915_switcheroo_can_switch,
 };
 
-static void i915_gem_fini(struct drm_i915_private *dev_priv)
-{
-       i915_gem_suspend_late(dev_priv);
-
-       /* Flush any outstanding unpin_work. */
-       i915_gem_drain_workqueue(dev_priv);
-
-       mutex_lock(&dev_priv->drm.struct_mutex);
-       intel_uc_fini_hw(dev_priv);
-       intel_uc_fini(dev_priv);
-       i915_gem_cleanup_engines(dev_priv);
-       i915_gem_contexts_fini(dev_priv);
-       mutex_unlock(&dev_priv->drm.struct_mutex);
-
-       intel_uc_fini_misc(dev_priv);
-       i915_gem_cleanup_userptr(dev_priv);
-
-       i915_gem_drain_freed_objects(dev_priv);
-
-       WARN_ON(!list_empty(&dev_priv->contexts.list));
-}
-
 static int i915_load_modeset_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = to_i915(dev);
index 38157df6ff5c66f91bc660fa3a7fdb4f01b37d15..ecc888a97279652c2f434dcfb39544ffef872d65 100644 (file)
@@ -3165,6 +3165,7 @@ void i915_gem_init_mmio(struct drm_i915_private *i915);
 int __must_check i915_gem_init(struct drm_i915_private *dev_priv);
 int __must_check i915_gem_init_hw(struct drm_i915_private *dev_priv);
 void i915_gem_init_swizzling(struct drm_i915_private *dev_priv);
+void i915_gem_fini(struct drm_i915_private *dev_priv);
 void i915_gem_cleanup_engines(struct drm_i915_private *dev_priv);
 int i915_gem_wait_for_idle(struct drm_i915_private *dev_priv,
                           unsigned int flags);
index 62974e8862d516c42c9de18a26b83bb64590bc4c..cb680ddafa0c5da762043f6b8183e5de91e8cd02 100644 (file)
@@ -5554,6 +5554,28 @@ err_unlock:
        return ret;
 }
 
+void i915_gem_fini(struct drm_i915_private *dev_priv)
+{
+       i915_gem_suspend_late(dev_priv);
+
+       /* Flush any outstanding unpin_work. */
+       i915_gem_drain_workqueue(dev_priv);
+
+       mutex_lock(&dev_priv->drm.struct_mutex);
+       intel_uc_fini_hw(dev_priv);
+       intel_uc_fini(dev_priv);
+       i915_gem_cleanup_engines(dev_priv);
+       i915_gem_contexts_fini(dev_priv);
+       mutex_unlock(&dev_priv->drm.struct_mutex);
+
+       intel_uc_fini_misc(dev_priv);
+       i915_gem_cleanup_userptr(dev_priv);
+
+       i915_gem_drain_freed_objects(dev_priv);
+
+       WARN_ON(!list_empty(&dev_priv->contexts.list));
+}
+
 void i915_gem_init_mmio(struct drm_i915_private *i915)
 {
        i915_gem_sanitize(i915);