diff mbox series

[17/31] drm/{i915, xe}: Move remaining intel_power_domains to intel_display

Message ID 20240924204222.246862-18-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show
Series Reconcile i915's and xe's display power mgt sequences | expand

Commit Message

Rodrigo Vivi Sept. 24, 2024, 8:35 p.m. UTC
Consolidate the intel_power_domains calls under
intel_display_driver.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_driver.c | 9 +++++++++
 drivers/gpu/drm/i915/display/intel_display_driver.h | 1 +
 drivers/gpu/drm/i915/i915_driver.c                  | 4 +---
 drivers/gpu/drm/xe/display/xe_display.c             | 4 +---
 4 files changed, 12 insertions(+), 6 deletions(-)

Comments

Cavitt, Jonathan Oct. 7, 2024, 9:27 p.m. UTC | #1
-----Original Message-----
From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Rodrigo Vivi
Sent: Tuesday, September 24, 2024 1:36 PM
To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
Cc: Deak, Imre <imre.deak@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>
Subject: [PATCH 17/31] drm/{i915, xe}: Move remaining intel_power_domains to intel_display
> 
> Consolidate the intel_power_domains calls under
> intel_display_driver.
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

LGTM.  I'd suggest splitting this patch into i915 and xe parts,
but for this patch in particular it might be a bit difficult.

Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
-Jonathan Cavitt

> ---
>  drivers/gpu/drm/i915/display/intel_display_driver.c | 9 +++++++++
>  drivers/gpu/drm/i915/display/intel_display_driver.h | 1 +
>  drivers/gpu/drm/i915/i915_driver.c                  | 4 +---
>  drivers/gpu/drm/xe/display/xe_display.c             | 4 +---
>  4 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
> index 2a171cb2613a..a64468e3a052 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_driver.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
> @@ -563,6 +563,13 @@ void intel_display_driver_register(struct drm_i915_private *i915)
>  
>  	intel_display_device_info_print(DISPLAY_INFO(i915),
>  					DISPLAY_RUNTIME_INFO(i915), &p);
> +
> +	intel_power_domains_enable(i915);
> +}
> +
> +void intel_display_driver_cleanup(struct drm_i915_private *i915)
> +{
> +	intel_power_domains_cleanup(i915);
>  }
>  
>  /* part #1: call before irq uninstall */
> @@ -640,6 +647,8 @@ void intel_display_driver_unregister(struct drm_i915_private *i915)
>  	if (!HAS_DISPLAY(i915))
>  		return;
>  
> +	intel_power_domains_disable(i915);
> +
>  	drm_client_dev_unregister(&i915->drm);
>  
>  	/*
> diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.h b/drivers/gpu/drm/i915/display/intel_display_driver.h
> index dec93f2f37c6..4b2c041667e0 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_driver.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_driver.h
> @@ -21,6 +21,7 @@ int intel_display_driver_probe_noirq(struct drm_i915_private *i915);
>  int intel_display_driver_probe_nogem(struct drm_i915_private *i915);
>  int intel_display_driver_probe(struct drm_i915_private *i915);
>  void intel_display_driver_register(struct drm_i915_private *i915);
> +void intel_display_driver_cleanup(struct drm_i915_private *i915);
>  void intel_display_driver_remove(struct drm_i915_private *i915);
>  void intel_display_driver_remove_noirq(struct drm_i915_private *i915);
>  void intel_display_driver_remove_nogem(struct drm_i915_private *i915);
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 9e788e1c178e..53960326b68d 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -281,7 +281,7 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
>  static void i915_driver_late_release(struct drm_i915_private *dev_priv)
>  {
>  	intel_irq_fini(dev_priv);
> -	intel_power_domains_cleanup(dev_priv);
> +	intel_display_driver_cleanup(dev_priv);
>  	i915_gem_cleanup_early(dev_priv);
>  	intel_gt_driver_late_release_all(dev_priv);
>  	intel_region_ttm_device_fini(dev_priv);
> @@ -627,7 +627,6 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
>  
>  	intel_display_driver_register(dev_priv);
>  
> -	intel_power_domains_enable(dev_priv);
>  	intel_runtime_pm_enable(&dev_priv->runtime_pm);
>  
>  	intel_register_dsm_handler();
> @@ -650,7 +649,6 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv)
>  	intel_unregister_dsm_handler();
>  
>  	intel_runtime_pm_disable(&dev_priv->runtime_pm);
> -	intel_power_domains_disable(dev_priv);
>  
>  	intel_display_driver_unregister(dev_priv);
>  
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index d5be622f831b..df66e47daca3 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -107,7 +107,7 @@ static void xe_display_fini_nommio(struct drm_device *dev, void *dummy)
>  	if (!xe->info.probe_display)
>  		return;
>  
> -	intel_power_domains_cleanup(xe);
> +	intel_display_driver_cleanup(xe);
>  }
>  
>  int xe_display_init_nommio(struct xe_device *xe)
> @@ -217,7 +217,6 @@ void xe_display_register(struct xe_device *xe)
>  		return;
>  
>  	intel_display_driver_register(xe);
> -	intel_power_domains_enable(xe);
>  	intel_register_dsm_handler();
>  }
>  
> @@ -227,7 +226,6 @@ void xe_display_unregister(struct xe_device *xe)
>  		return;
>  
>  	intel_unregister_dsm_handler();
> -	intel_power_domains_disable(xe);
>  	intel_display_driver_unregister(xe);
>  }
>  
> -- 
> 2.46.0
> 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
index 2a171cb2613a..a64468e3a052 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.c
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
@@ -563,6 +563,13 @@  void intel_display_driver_register(struct drm_i915_private *i915)
 
 	intel_display_device_info_print(DISPLAY_INFO(i915),
 					DISPLAY_RUNTIME_INFO(i915), &p);
+
+	intel_power_domains_enable(i915);
+}
+
+void intel_display_driver_cleanup(struct drm_i915_private *i915)
+{
+	intel_power_domains_cleanup(i915);
 }
 
 /* part #1: call before irq uninstall */
@@ -640,6 +647,8 @@  void intel_display_driver_unregister(struct drm_i915_private *i915)
 	if (!HAS_DISPLAY(i915))
 		return;
 
+	intel_power_domains_disable(i915);
+
 	drm_client_dev_unregister(&i915->drm);
 
 	/*
diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.h b/drivers/gpu/drm/i915/display/intel_display_driver.h
index dec93f2f37c6..4b2c041667e0 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.h
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.h
@@ -21,6 +21,7 @@  int intel_display_driver_probe_noirq(struct drm_i915_private *i915);
 int intel_display_driver_probe_nogem(struct drm_i915_private *i915);
 int intel_display_driver_probe(struct drm_i915_private *i915);
 void intel_display_driver_register(struct drm_i915_private *i915);
+void intel_display_driver_cleanup(struct drm_i915_private *i915);
 void intel_display_driver_remove(struct drm_i915_private *i915);
 void intel_display_driver_remove_noirq(struct drm_i915_private *i915);
 void intel_display_driver_remove_nogem(struct drm_i915_private *i915);
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 9e788e1c178e..53960326b68d 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -281,7 +281,7 @@  static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
 static void i915_driver_late_release(struct drm_i915_private *dev_priv)
 {
 	intel_irq_fini(dev_priv);
-	intel_power_domains_cleanup(dev_priv);
+	intel_display_driver_cleanup(dev_priv);
 	i915_gem_cleanup_early(dev_priv);
 	intel_gt_driver_late_release_all(dev_priv);
 	intel_region_ttm_device_fini(dev_priv);
@@ -627,7 +627,6 @@  static void i915_driver_register(struct drm_i915_private *dev_priv)
 
 	intel_display_driver_register(dev_priv);
 
-	intel_power_domains_enable(dev_priv);
 	intel_runtime_pm_enable(&dev_priv->runtime_pm);
 
 	intel_register_dsm_handler();
@@ -650,7 +649,6 @@  static void i915_driver_unregister(struct drm_i915_private *dev_priv)
 	intel_unregister_dsm_handler();
 
 	intel_runtime_pm_disable(&dev_priv->runtime_pm);
-	intel_power_domains_disable(dev_priv);
 
 	intel_display_driver_unregister(dev_priv);
 
diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
index d5be622f831b..df66e47daca3 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -107,7 +107,7 @@  static void xe_display_fini_nommio(struct drm_device *dev, void *dummy)
 	if (!xe->info.probe_display)
 		return;
 
-	intel_power_domains_cleanup(xe);
+	intel_display_driver_cleanup(xe);
 }
 
 int xe_display_init_nommio(struct xe_device *xe)
@@ -217,7 +217,6 @@  void xe_display_register(struct xe_device *xe)
 		return;
 
 	intel_display_driver_register(xe);
-	intel_power_domains_enable(xe);
 	intel_register_dsm_handler();
 }
 
@@ -227,7 +226,6 @@  void xe_display_unregister(struct xe_device *xe)
 		return;
 
 	intel_unregister_dsm_handler();
-	intel_power_domains_disable(xe);
 	intel_display_driver_unregister(xe);
 }