[PATCH 08/10] drm/i915: Periodically flush the active lists and requests

From: Chris Wilson
Date: Fri Jun 17 2011 - 11:04:22 EST


BugLink: http://bugs.launchpad.net/bugs/599017

In order to retire active buffers whilst no client is active, we need to
insert our own flush requests onto the ring.

This is useful for servers that queue up some rendering and then go to
sleep as it allows us to the complete processing of those requests,
potentially making that memory available again much earlier.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
(backported from commit 0a58705b2fc3fa29525cf2fdae3d4276a5771280 upstream)

Signed-off-by: Seth Forshee <seth.forshee@xxxxxxxxxxxxx>
Signed-off-by: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
---
drivers/gpu/drm/i915/i915_gem.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b3c7bd1..0314f7f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1862,9 +1862,16 @@ i915_gem_retire_work_handler(struct work_struct *work)

mutex_lock(&dev->struct_mutex);
i915_gem_retire_requests(dev);
+
+ if (!list_empty(&dev_priv->mm.gpu_write_list)) {
+ i915_gem_flush(dev, 0, I915_GEM_GPU_DOMAINS);
+ i915_add_request(dev, NULL, I915_GEM_GPU_DOMAINS);
+ }
+
if (!dev_priv->mm.suspended &&
!list_empty(&dev_priv->mm.request_list))
queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
+
mutex_unlock(&dev->struct_mutex);
}

--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/