summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorEric Anholt2009-02-18 18:44:56 +0100
committerDave Airlie2009-02-23 01:06:26 +0100
commitf21289b355cee8738d80c2ae5cbd272c3f7b5689 (patch)
tree3c490c815c6aaed1bb48da0be455fa7273c40136 /drivers/gpu/drm/i915/i915_gem.c
parentdrm/i915: suspend/resume GEM when KMS is active (diff)
downloadkernel-qcow2-linux-f21289b355cee8738d80c2ae5cbd272c3f7b5689.tar.gz
kernel-qcow2-linux-f21289b355cee8738d80c2ae5cbd272c3f7b5689.tar.xz
kernel-qcow2-linux-f21289b355cee8738d80c2ae5cbd272c3f7b5689.zip
drm/i915: Retire requests from i915_gem_busy_ioctl.
This ensures that the user gets the latest information from the hardware on whether the buffer is busy, potentially reducing the working set of objects that the user chooses. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c7
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 58c789da95a3..8b50d4820389 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2872,6 +2872,13 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
return -EBADF;
}
+ /* Update the active list for the hardware's current position.
+ * Otherwise this only updates on a delayed timer or when irqs are
+ * actually unmasked, and our working set ends up being larger than
+ * required.
+ */
+ i915_gem_retire_requests(dev);
+
obj_priv = obj->driver_private;
/* Don't count being on the flushing list against the object being
* done. Otherwise, a buffer left on the flushing list but not getting