Call the opregion register/unregister functions during driver loading/unloading on !HAS_DISPLAY platforms. These functions will send the opregion adapter power state notifications which is required on all platforms (similarly how this is sent during runtime and system suspend/resume). Skip registering the ACPI video notifier callback on !HAS_DISPLAY, where the corresponding video extensions are not supported. Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx> --- drivers/gpu/drm/i915/display/intel_display.c | 11 +++++++---- drivers/gpu/drm/i915/display/intel_opregion.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 7827ef3e2d1e6..467f6e2376057 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -8882,11 +8882,12 @@ bool intel_modeset_probe_defer(struct pci_dev *pdev) void intel_display_driver_register(struct drm_i915_private *i915) { - if (!HAS_DISPLAY(i915)) - return; - /* Must be done after probing outputs */ intel_opregion_register(i915); + + if (!HAS_DISPLAY(i915)) + return; + intel_acpi_video_register(i915); intel_audio_init(i915); @@ -8914,7 +8915,7 @@ void intel_display_driver_register(struct drm_i915_private *i915) void intel_display_driver_unregister(struct drm_i915_private *i915) { if (!HAS_DISPLAY(i915)) - return; + goto unregister_opregion; intel_fbdev_unregister(i915); intel_audio_deinit(i915); @@ -8928,6 +8929,8 @@ void intel_display_driver_unregister(struct drm_i915_private *i915) drm_atomic_helper_shutdown(&i915->drm); acpi_video_unregister(); + +unregister_opregion: intel_opregion_unregister(i915); } diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c index b7973a05d022d..37098e7f607e6 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.c +++ b/drivers/gpu/drm/i915/display/intel_opregion.c @@ -1150,7 +1150,7 @@ void intel_opregion_register(struct drm_i915_private *i915) if (!opregion->header) return; - if (opregion->acpi) { + if (HAS_DISPLAY(i915) && opregion->acpi) { opregion->acpi_notifier.notifier_call = intel_opregion_video_event; register_acpi_notifier(&opregion->acpi_notifier); -- 2.37.1