diff options
author | Jani Nikula <jani.nikula@intel.com> | 2013-10-31 12:55:48 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-06 11:55:16 -0500 |
commit | 91a60f20712179e56b7a6c3d332a5f6f9a54aa11 (patch) | |
tree | 558121398fc14245ea7ceba3cbf89cad43c7b00e /drivers/gpu/drm/i915/intel_opregion.c | |
parent | 7b5562d401c760814110385baa574480e4ce12f9 (diff) |
drm/i915: move opregion asle request handling to a work queue
Doing this has been long overdue anyway, but now we really need it in
preparation for per connector backlight handling.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_opregion.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_opregion.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index b82050c96f3e..892d520175d8 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c | |||
@@ -486,9 +486,13 @@ static u32 asle_isct_state(struct drm_device *dev) | |||
486 | return ASLC_ISCT_STATE_FAILED; | 486 | return ASLC_ISCT_STATE_FAILED; |
487 | } | 487 | } |
488 | 488 | ||
489 | void intel_opregion_asle_intr(struct drm_device *dev) | 489 | static void asle_work(struct work_struct *work) |
490 | { | 490 | { |
491 | struct drm_i915_private *dev_priv = dev->dev_private; | 491 | struct intel_opregion *opregion = |
492 | container_of(work, struct intel_opregion, asle_work); | ||
493 | struct drm_i915_private *dev_priv = | ||
494 | container_of(opregion, struct drm_i915_private, opregion); | ||
495 | struct drm_device *dev = dev_priv->dev; | ||
492 | struct opregion_asle __iomem *asle = dev_priv->opregion.asle; | 496 | struct opregion_asle __iomem *asle = dev_priv->opregion.asle; |
493 | u32 aslc_stat = 0; | 497 | u32 aslc_stat = 0; |
494 | u32 aslc_req; | 498 | u32 aslc_req; |
@@ -535,6 +539,14 @@ void intel_opregion_asle_intr(struct drm_device *dev) | |||
535 | iowrite32(aslc_stat, &asle->aslc); | 539 | iowrite32(aslc_stat, &asle->aslc); |
536 | } | 540 | } |
537 | 541 | ||
542 | void intel_opregion_asle_intr(struct drm_device *dev) | ||
543 | { | ||
544 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
545 | |||
546 | if (dev_priv->opregion.asle) | ||
547 | schedule_work(&dev_priv->opregion.asle_work); | ||
548 | } | ||
549 | |||
538 | #define ACPI_EV_DISPLAY_SWITCH (1<<0) | 550 | #define ACPI_EV_DISPLAY_SWITCH (1<<0) |
539 | #define ACPI_EV_LID (1<<1) | 551 | #define ACPI_EV_LID (1<<1) |
540 | #define ACPI_EV_DOCK (1<<2) | 552 | #define ACPI_EV_DOCK (1<<2) |
@@ -735,6 +747,8 @@ void intel_opregion_fini(struct drm_device *dev) | |||
735 | if (opregion->asle) | 747 | if (opregion->asle) |
736 | iowrite32(ASLE_ARDY_NOT_READY, &opregion->asle->ardy); | 748 | iowrite32(ASLE_ARDY_NOT_READY, &opregion->asle->ardy); |
737 | 749 | ||
750 | cancel_work_sync(&dev_priv->opregion.asle_work); | ||
751 | |||
738 | if (opregion->acpi) { | 752 | if (opregion->acpi) { |
739 | iowrite32(0, &opregion->acpi->drdy); | 753 | iowrite32(0, &opregion->acpi->drdy); |
740 | 754 | ||
@@ -828,6 +842,8 @@ int intel_opregion_setup(struct drm_device *dev) | |||
828 | return -ENOTSUPP; | 842 | return -ENOTSUPP; |
829 | } | 843 | } |
830 | 844 | ||
845 | INIT_WORK(&opregion->asle_work, asle_work); | ||
846 | |||
831 | base = acpi_os_ioremap(asls, OPREGION_SIZE); | 847 | base = acpi_os_ioremap(asls, OPREGION_SIZE); |
832 | if (!base) | 848 | if (!base) |
833 | return -ENOMEM; | 849 | return -ENOMEM; |