[11/11] drm/i915: remove the now redundant i915_driver_modeset_* call layer

Submitted by Jani Nikula on Oct. 7, 2019, 3:09 p.m.

Details

Message ID 878e502fd84d36af5370b4592637acc1389d9e8e.1570460714.git.jani.nikula@intel.com
State New
Headers show
Series "drm/i915: modeset probe/remove cleanup" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Jani Nikula Oct. 7, 2019, 3:09 p.m.
The i915_driver_modeset_*() functions have become irrelevant, and the
extra layer can be removed.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 76 +++++++++------------------------
 1 file changed, 19 insertions(+), 57 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 5a778944d7a8..2e19e70b3963 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -269,58 +269,6 @@  intel_teardown_mchbar(struct drm_i915_private *dev_priv)
 		release_resource(&dev_priv->mch_res);
 }
 
-/* part #1: call before irq install */
-static int i915_driver_modeset_probe_noirq(struct drm_i915_private *i915)
-{
-	return intel_modeset_init_noirq(i915);
-}
-
-/* part #2: call after irq install */
-static int i915_driver_modeset_probe(struct drm_i915_private *i915)
-{
-	int ret;
-
-	/* Important: The output setup functions called by modeset_init need
-	 * working irqs for e.g. gmbus and dp aux transfers. */
-	ret = intel_modeset_init_nogem(i915);
-	if (ret)
-		goto out;
-
-	ret = i915_gem_init(i915);
-	if (ret)
-		goto cleanup_modeset;
-
-	ret = intel_modeset_init(i915);
-	if (ret)
-		goto cleanup_gem;
-
-	return 0;
-
-cleanup_gem:
-	i915_gem_suspend(i915);
-	i915_gem_driver_remove(i915);
-	i915_gem_driver_release(i915);
-cleanup_modeset:
-	/* FIXME */
-	intel_modeset_driver_remove(i915);
-	intel_irq_uninstall(i915);
-	intel_modeset_driver_remove_noirq(i915);
-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_modeset_driver_remove_noirq(i915);
-}
-
 static void intel_init_dpio(struct drm_i915_private *dev_priv)
 {
 	/*
@@ -1466,7 +1414,7 @@  int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	intel_power_domains_init_hw(i915, false);
 
-	ret = i915_driver_modeset_probe_noirq(i915);
+	ret = intel_modeset_init_noirq(i915);
 	if (ret < 0)
 		goto out_cleanup_hw;
 
@@ -1474,10 +1422,20 @@  int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto out_cleanup_modeset;
 
-	ret = i915_driver_modeset_probe(i915);
-	if (ret < 0)
+	/* Important: The output setup functions called by modeset_init need
+	 * working irqs for e.g. gmbus and dp aux transfers. */
+	ret = intel_modeset_init_nogem(i915);
+	if (ret)
 		goto out_cleanup_irq;
 
+	ret = i915_gem_init(i915);
+	if (ret)
+		goto out_cleanup_modeset;
+
+	ret = intel_modeset_init(i915);
+	if (ret)
+		goto out_cleanup_gem;
+
 	i915_driver_register(i915);
 
 	enable_rpm_wakeref_asserts(&i915->runtime_pm);
@@ -1486,6 +1444,10 @@  int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	return 0;
 
+out_cleanup_gem:
+	i915_gem_suspend(i915);
+	i915_gem_driver_remove(i915);
+	i915_gem_driver_release(i915);
 out_cleanup_irq:
 	intel_irq_uninstall(i915);
 out_cleanup_modeset:
@@ -1529,11 +1491,11 @@  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);
 
-	i915_driver_modeset_remove_noirq(i915);
+	intel_modeset_driver_remove_noirq(i915);
 
 	/* Free error state after interrupts are fully disabled. */
 	cancel_delayed_work_sync(&i915->gt.hangcheck.work);

Comments

Quoting Jani Nikula (2019-10-07 16:09:36)
> The i915_driver_modeset_*() functions have become irrelevant, and the
> extra layer can be removed.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 76 +++++++++------------------------
>  1 file changed, 19 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 5a778944d7a8..2e19e70b3963 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -269,58 +269,6 @@ intel_teardown_mchbar(struct drm_i915_private *dev_priv)
>                 release_resource(&dev_priv->mch_res);
>  }
>  
> -/* part #1: call before irq install */
> -static int i915_driver_modeset_probe_noirq(struct drm_i915_private *i915)
> -{
> -       return intel_modeset_init_noirq(i915);
> -}
> -
> -/* part #2: call after irq install */
> -static int i915_driver_modeset_probe(struct drm_i915_private *i915)
> -{
> -       int ret;
> -
> -       /* Important: The output setup functions called by modeset_init need
> -        * working irqs for e.g. gmbus and dp aux transfers. */
> -       ret = intel_modeset_init_nogem(i915);
> -       if (ret)
> -               goto out;
> -
> -       ret = i915_gem_init(i915);
> -       if (ret)
> -               goto cleanup_modeset;
> -
> -       ret = intel_modeset_init(i915);
> -       if (ret)
> -               goto cleanup_gem;
> -
> -       return 0;
> -
> -cleanup_gem:
> -       i915_gem_suspend(i915);
> -       i915_gem_driver_remove(i915);
> -       i915_gem_driver_release(i915);
> -cleanup_modeset:
> -       /* FIXME */
> -       intel_modeset_driver_remove(i915);
> -       intel_irq_uninstall(i915);
> -       intel_modeset_driver_remove_noirq(i915);
> -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_modeset_driver_remove_noirq(i915);
> -}
> -
>  static void intel_init_dpio(struct drm_i915_private *dev_priv)
>  {
>         /*
> @@ -1466,7 +1414,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>         intel_power_domains_init_hw(i915, false);
>  
> -       ret = i915_driver_modeset_probe_noirq(i915);
> +       ret = intel_modeset_init_noirq(i915);
>         if (ret < 0)
>                 goto out_cleanup_hw;
>  
> @@ -1474,10 +1422,20 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>         if (ret)
>                 goto out_cleanup_modeset;
>  
> -       ret = i915_driver_modeset_probe(i915);
> -       if (ret < 0)
> +       /* Important: The output setup functions called by modeset_init need
> +        * working irqs for e.g. gmbus and dp aux transfers. */
> +       ret = intel_modeset_init_nogem(i915);
> +       if (ret)
>                 goto out_cleanup_irq;
>  
> +       ret = i915_gem_init(i915);
> +       if (ret)
> +               goto out_cleanup_modeset;
> +
> +       ret = intel_modeset_init(i915);
> +       if (ret)
> +               goto out_cleanup_gem;

Fwiw, I'm really digging the nomenclature, and I think it is the biggest
advance made in sorting out the init sequence.
-Chris