drm/i915: split out intel_modeset_driver_remove_nogem() and simplify
authorJani Nikula <jani.nikula@intel.com>
Wed, 2 Sep 2020 14:30:22 +0000 (17:30 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 4 Sep 2020 10:28:34 +0000 (13:28 +0300)
Split out a separate display function for driver remove after gem
deinitialization. Note that the sequence is not symmetric with
init. However use similar naming as that reflects the deinit sequence.

No functional changes.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/197fa7e488b412e147ff0fe9440c48811888f1a6.1599056955.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display.h
drivers/gpu/drm/i915/i915_drv.c

index 459267b..2ccb2cb 100644 (file)
@@ -18946,6 +18946,18 @@ void intel_modeset_driver_remove_noirq(struct drm_i915_private *i915)
        intel_fbc_cleanup_cfb(i915);
 }
 
+/* part #3: call after gem init */
+void intel_modeset_driver_remove_nogem(struct drm_i915_private *i915)
+{
+       intel_csr_ucode_fini(i915);
+
+       intel_power_domains_driver_remove(i915);
+
+       intel_vga_unregister(i915);
+
+       intel_bios_driver_remove(i915);
+}
+
 #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
 
 struct intel_display_error_state {
index 63130e1..3670cab 100644 (file)
@@ -633,6 +633,7 @@ int intel_modeset_init_nogem(struct drm_i915_private *i915);
 int intel_modeset_init(struct drm_i915_private *i915);
 void intel_modeset_driver_remove(struct drm_i915_private *i915);
 void intel_modeset_driver_remove_noirq(struct drm_i915_private *i915);
+void intel_modeset_driver_remove_nogem(struct drm_i915_private *i915);
 void intel_display_resume(struct drm_device *dev);
 void intel_init_pch_refclk(struct drm_i915_private *dev_priv);
 
index 3737e1f..452c86a 100644 (file)
@@ -255,24 +255,6 @@ out:
        return ret;
 }
 
-/* part #1: call before irq uninstall */
-static void i915_driver_modeset_remove(struct drm_i915_private *i915)
-{
-       intel_modeset_driver_remove(i915);
-}
-
-/* part #2: call after irq uninstall */
-static void i915_driver_modeset_remove_noirq(struct drm_i915_private *i915)
-{
-       intel_csr_ucode_fini(i915);
-
-       intel_power_domains_driver_remove(i915);
-
-       intel_vga_unregister(i915);
-
-       intel_bios_driver_remove(i915);
-}
-
 static void intel_init_dpio(struct drm_i915_private *dev_priv)
 {
        /*
@@ -966,7 +948,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 out_cleanup_irq:
        intel_irq_uninstall(i915);
 out_cleanup_modeset:
-       i915_driver_modeset_remove_noirq(i915);
+       intel_modeset_driver_remove_nogem(i915);
 out_cleanup_hw:
        i915_driver_hw_remove(i915);
        intel_memory_regions_driver_release(i915);
@@ -998,7 +980,7 @@ void i915_driver_remove(struct drm_i915_private *i915)
 
        intel_gvt_driver_remove(i915);
 
-       i915_driver_modeset_remove(i915);
+       intel_modeset_driver_remove(i915);
 
        intel_irq_uninstall(i915);
 
@@ -1007,7 +989,7 @@ void i915_driver_remove(struct drm_i915_private *i915)
        i915_reset_error_state(i915);
        i915_gem_driver_remove(i915);
 
-       i915_driver_modeset_remove_noirq(i915);
+       intel_modeset_driver_remove_nogem(i915);
 
        i915_driver_hw_remove(i915);