summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@jsg.id.au>2013-02-27 13:17:17 +1100
committerJonathan Gray <jsg@jsg.id.au>2013-02-27 13:17:17 +1100
commit0d78efcc4330855fa3be1af35ca3317f8c6253f4 (patch)
tree342ddfa534b8a5d7b2ab41cf7bad4ec8a3e70241 /sys/dev/pci
parentbb420278b88f448b80b5cc19d2ba4c3304aed26b (diff)
add rps tasks to the system workq
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/i915_drv.h4
-rw-r--r--sys/dev/pci/drm/i915_irq.c21
2 files changed, 8 insertions, 17 deletions
diff --git a/sys/dev/pci/drm/i915_drv.h b/sys/dev/pci/drm/i915_drv.h
index 2c1cc3c0bbb..215629ab708 100644
--- a/sys/dev/pci/drm/i915_drv.h
+++ b/sys/dev/pci/drm/i915_drv.h
@@ -427,9 +427,7 @@ struct i915_suspend_saved_registers {
};
struct intel_gen6_power_mgmt {
-#if 0
- struct work_struct work;
-#endif
+ struct workq_task task;
u32 pm_iir;
/* lock - irqsave spinlock that protectects the work_struct and
* pm_iir. */
diff --git a/sys/dev/pci/drm/i915_irq.c b/sys/dev/pci/drm/i915_irq.c
index a220eab8ab0..566edd61c88 100644
--- a/sys/dev/pci/drm/i915_irq.c
+++ b/sys/dev/pci/drm/i915_irq.c
@@ -90,6 +90,7 @@ void intel_irq_init(struct drm_device *);
void i915_hotplug_work_func(void *, void *);
void i915_error_work_func(void *, void *);
void ivybridge_parity_work(void *, void *);
+void gen6_pm_rps_work(void *, void *);
/* For display hotplug interrupt */
void
@@ -427,12 +428,11 @@ notify_ring(struct drm_device *dev,
#endif
}
-#ifdef notyet
void
-gen6_pm_rps_work(struct work_struct *work)
+gen6_pm_rps_work(void *arg1, void *arg2)
{
- drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t,
- rps.work);
+ drm_i915_private_t *dev_priv = arg1;
+ struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
u32 pm_iir, pm_imr;
u8 new_delay;
@@ -458,13 +458,11 @@ gen6_pm_rps_work(struct work_struct *work)
*/
if (!(new_delay > dev_priv->rps.max_delay ||
new_delay < dev_priv->rps.min_delay)) {
- gen6_set_rps(dev_priv->dev, new_delay);
+ gen6_set_rps(dev, new_delay);
}
rw_exit_write(&dev_priv->rps.hw_lock);
}
-#endif
-
/**
* ivybridge_parity_work - Workqueue called when a parity error interrupt
@@ -598,9 +596,8 @@ gen6_queue_rps_work(struct inteldrm_softc *dev_priv,
POSTING_READ(GEN6_PMIMR);
mtx_leave(&dev_priv->rps.lock);
-#ifdef notyet
- queue_work(dev_priv->wq, &dev_priv->rps.work);
-#endif
+ workq_queue_task(NULL, &dev_priv->rps.task, 0, gen6_pm_rps_work,
+ dev_priv, NULL);
}
int
@@ -2852,10 +2849,6 @@ intel_irq_init(struct drm_device *dev)
{
// struct inteldrm_softc *dev_priv = dev->dev_private;
-#ifdef notyet
- INIT_WORK(&dev_priv->rps.work, gen6_pm_rps_work);
-#endif
-
dev->driver->get_vblank_counter = i915_get_vblank_counter;
dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
if (IS_G4X(dev) || INTEL_INFO(dev)->gen >= 5) {