diff mbox series

[CI,8/9] drm/{i915, xe}: Move remaining intel_power_domains to intel_display

Message ID 20241111193947.128871-8-rodrigo.vivi@intel.com (mailing list archive)
State New
Headers show
Series [CI,1/9] drm/i915: Remove vga and gmbus seq out of i915_restore_display | expand

Commit Message

Rodrigo Vivi Nov. 11, 2024, 7:39 p.m. UTC
Consolidate the intel_power_domains calls under
intel_display_driver.

Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
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(-)
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 06a60be649ee..3b8b544d6da3 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.c
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
@@ -561,6 +561,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 */
@@ -638,6 +645,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 42cc4af6d3fd..d1408aa124ef 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.h
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.h
@@ -20,6 +20,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 dee9c6b9d6e9..946c1b81809b 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -287,7 +287,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);
@@ -634,7 +634,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();
@@ -657,7 +656,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 737f04f45cd4..28e9c8648e76 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)
@@ -219,7 +219,6 @@  void xe_display_register(struct xe_device *xe)
 		return;
 
 	intel_display_driver_register(xe);
-	intel_power_domains_enable(xe);
 	intel_register_dsm_handler();
 }
 
@@ -229,7 +228,6 @@  void xe_display_unregister(struct xe_device *xe)
 		return;
 
 	intel_unregister_dsm_handler();
-	intel_power_domains_disable(xe);
 	intel_display_driver_unregister(xe);
 }