i915: Unregister ACPI video driver when exiting
Subsystems (4)
PATCH 1/2 i915: Unregister ACPI video driver when exiting
The i915 DRM triggers registration of the ACPI video driver on load. It should unregister it at unload in order to avoid generating backtraces on being reloaded.
Signed-off-by Matthew Garrett <[email protected]>
--- drivers/acpi/video.c | 3 ++- drivers/gpu/drm/i915/i915_dma.c | 2 +- drivers/gpu/drm/i915/i915_drv.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/i915_opregion.c | 5 ++++- include/acpi/video.h | 2 ++ 6 files changed, 12 insertions(+), 6 deletions(-)
drivers/acpi/video.c +2 -1
@@ -2306,7 +2306,7 @@ static int __init acpi_video_init(void)return acpi_video_register (); } -static void __exit acpi_video_exit(void) +void __exit acpi_video_exit(void) {acpi_bus_unregister_driver (&acpi_video_bus);
@@ -2315,6 +2315,7 @@ static void __exit acpi_video_exit(void)return ; } +EXPORT_SYMBOL (acpi_video_exit);module_init (acpi_video_init);module_exit (acpi_video_exit);
drivers/gpu/drm/i915/i915_dma.c +1 -1
@@ -1239,7 +1239,7 @@ int i915_driver_unload(struct drm_device *dev)if (dev_priv->regs !=NULL )iounmap (dev_priv->regs); -intel_opregion_free (dev); +intel_opregion_free (dev,0 );if (drm_core_check_feature (dev,DRIVER_MODESET )) {intel_modeset_cleanup (dev);
drivers/gpu/drm/i915/i915_drv.c +1 -1
@@ -77,7 +77,7 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)drm_irq_uninstall (dev); } -intel_opregion_free (dev); +intel_opregion_free (dev,1 );if (state.event ==PM_EVENT_SUSPEND ) {/* Shut down the device */
drivers/gpu/drm/i915/i915_drv.h +2 -2
@@ -663,12 +663,12 @@ extern int i915_restore_state(struct drm_device *dev);#ifdef CONFIG_ACPI /* i915_opregion.c */ extern int intel_opregion_init (struct drm_device *dev,int resume); -extern void intel_opregion_free (struct drm_device *dev); +extern void intel_opregion_free (struct drm_device *dev,int suspend);extern void opregion_asle_intr (struct drm_device *dev);extern void opregion_enable_asle (struct drm_device *dev);#else static inline int intel_opregion_init (struct drm_device *dev,int resume) {return 0 ; } -static inline void intel_opregion_free (struct drm_device *dev) {return ; } +static inline void intel_opregion_free (struct drm_device *dev,int suspend) {return ; }static inline void opregion_asle_intr (struct drm_device *dev) {return ; }static inline void opregion_enable_asle (struct drm_device *dev) {return ; }#endif
drivers/gpu/drm/i915/i915_opregion.c +4 -1
@@ -408,7 +408,7 @@ err_out:return err; } -void intel_opregion_free (struct drm_device *dev) +void intel_opregion_free (struct drm_device *dev,int suspend) {struct drm_i915_private *dev_priv = dev->dev_private;struct intel_opregion *opregion = &dev_priv->opregion;
@@ -416,6 +416,9 @@ void intel_opregion_free(struct drm_device *dev)if (!opregion->enabled)return ; +if (!suspend) +acpi_video_exit (); + opregion->acpi->drdy =0 ; system_opregion =NULL ;
include/acpi/video.h +2 -0
@@ -3,8 +3,10 @@#if (definedCONFIG_ACPI_VIDEO || definedCONFIG_ACPI_VIDEO_MODULE )extern int acpi_video_register (void ); +extern int acpi_video_exit (void );#else static inline int acpi_video_register (void ) {return 0 ; } +static inline void acpi_video_exit (void ) {return ; }#endif #endif
Signature · 1 line
Matthew Garrett | [email protected]
PATCH 2/2 i915: Enable ASLE if present
The changes to opregion initialisation order meant that the ASLE setup code might not be run at the correct time. Ensure that the interrupts are set up.
Signed-off-by Matthew Garrett <[email protected]>
--- drivers/gpu/drm/i915/i915_opregion.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_opregion.c +1 -0
@@ -389,6 +389,7 @@ int intel_opregion_init(struct drm_device *dev, int resume)if (mboxes &MBOX_ASLE ) {DRM_DEBUG ("ASLE supported\n" ); opregion->asle = base +OPREGION_ASLE_OFFSET ; +opregion_enable_asle (dev); }/* Notify BIOS we are ready to handle ACPI video ext notifs.
Signature · 1 line
Matthew Garrett | [email protected]