Move dsm register/unregister calls from the drivers to under intel_display_driver register/unregister. Reviewed-by: Jonathan Cavitt <jonathan.cavitt@xxxxxxxxx> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> --- drivers/gpu/drm/i915/display/intel_display_driver.c | 4 ++++ drivers/gpu/drm/i915/i915_driver.c | 5 ----- drivers/gpu/drm/xe/display/xe_display.c | 3 --- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c index 3b8b544d6da3..194dc9d5ad4f 100644 --- a/drivers/gpu/drm/i915/display/intel_display_driver.c +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c @@ -563,6 +563,8 @@ void intel_display_driver_register(struct drm_i915_private *i915) DISPLAY_RUNTIME_INFO(i915), &p); intel_power_domains_enable(i915); + + intel_register_dsm_handler(); } void intel_display_driver_cleanup(struct drm_i915_private *i915) @@ -645,6 +647,8 @@ void intel_display_driver_unregister(struct drm_i915_private *i915) if (!HAS_DISPLAY(i915)) return; + intel_unregister_dsm_handler(); + intel_power_domains_disable(i915); drm_client_dev_unregister(&i915->drm); diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index 946c1b81809b..a60bca5580c5 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -46,7 +46,6 @@ #include <drm/drm_probe_helper.h> #include "display/i9xx_display_sr.h" -#include "display/intel_acpi.h" #include "display/intel_bw.h" #include "display/intel_cdclk.h" #include "display/intel_crtc.h" @@ -636,8 +635,6 @@ static void i915_driver_register(struct drm_i915_private *dev_priv) intel_runtime_pm_enable(&dev_priv->runtime_pm); - intel_register_dsm_handler(); - if (i915_switcheroo_register(dev_priv)) drm_err(&dev_priv->drm, "Failed to register vga switcheroo!\n"); } @@ -653,8 +650,6 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv) i915_switcheroo_unregister(dev_priv); - intel_unregister_dsm_handler(); - intel_runtime_pm_disable(&dev_priv->runtime_pm); 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 28e9c8648e76..2525eaf9a9a5 100644 --- a/drivers/gpu/drm/xe/display/xe_display.c +++ b/drivers/gpu/drm/xe/display/xe_display.c @@ -14,7 +14,6 @@ #include <uapi/drm/xe_drm.h> #include "soc/intel_dram.h" -#include "intel_acpi.h" #include "intel_audio.h" #include "intel_bw.h" #include "intel_display.h" @@ -219,7 +218,6 @@ void xe_display_register(struct xe_device *xe) return; intel_display_driver_register(xe); - intel_register_dsm_handler(); } void xe_display_unregister(struct xe_device *xe) @@ -227,7 +225,6 @@ void xe_display_unregister(struct xe_device *xe) if (!xe->info.probe_display) return; - intel_unregister_dsm_handler(); intel_display_driver_unregister(xe); } -- 2.47.0