summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/i915_gem.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@jsg.id.au>2013-03-09 10:18:40 +1100
committerJonathan Gray <jsg@jsg.id.au>2013-03-09 10:18:40 +1100
commit1a4983a3caaee27bd610264bb65aad7cf90628a3 (patch)
tree58b39f05e7ba62b5c3398b51fe5e0b5de09943f1 /sys/dev/pci/drm/i915_gem.c
parentac8b5dfce209db601713bc753816881b0e6ba182 (diff)
move the retire work handler to i915_gem.c
Diffstat (limited to 'sys/dev/pci/drm/i915_gem.c')
-rw-r--r--sys/dev/pci/drm/i915_gem.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915_gem.c b/sys/dev/pci/drm/i915_gem.c
index 64ae61de7fc..99976a39caa 100644
--- a/sys/dev/pci/drm/i915_gem.c
+++ b/sys/dev/pci/drm/i915_gem.c
@@ -1240,7 +1240,25 @@ i915_gem_retire_requests(struct inteldrm_softc *dev_priv)
i915_gem_retire_requests_ring(ring);
}
-// i915_gem_retire_work_handler
+void
+i915_gem_retire_work_handler(void *arg1, void *unused)
+{
+ struct inteldrm_softc *dev_priv = arg1;
+ struct intel_ring_buffer *ring;
+ bool idle;
+ int i;
+
+ i915_gem_retire_requests(dev_priv);
+ idle = true;
+ for_each_ring(ring, dev_priv, i) {
+ if (ring->gpu_caches_dirty)
+ i915_add_request(ring, NULL, NULL);
+
+ idle &= list_empty(&ring->request_list);
+ }
+ if (!dev_priv->mm.suspended && !idle)
+ timeout_add_sec(&dev_priv->mm.retire_timer, 1);
+}
/**
* Ensures that an object will eventually get non-busy by flushing any required