[Intel-gfx] [PATCH 1/2] seqno

Chris Wilson chris at chris-wilson.co.uk
Thu May 3 13:35:00 CEST 2012


---
 drivers/gpu/drm/i915/i915_gem.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 1fadb02..4f270e8 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3599,6 +3599,8 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
 	 */
 	args->busy = obj->active;
 	if (args->busy) {
+		u32 seqno;
+
 		/* Unconditionally flush objects, even when the gpu still uses this
 		 * object. Userspace calling this function indicates that it wants to
 		 * use this buffer rather sooner than later, so issuing the required
@@ -3617,7 +3619,10 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
 		 * timer or when irqs are actually unmasked, and our
 		 * working set ends up being larger than required.
 		 */
-		i915_gem_retire_requests_ring(obj->ring, 0);
+		seqno = obj->last_rendering_seqno;
+		if (!i915_seqno_passed(obj->ring->last_seqno, seqno))
+			seqno = 0;
+		i915_gem_retire_requests_ring(obj->ring, seqno);
 		args->busy = obj->active;
 	}
 
-- 
1.7.10




More information about the Intel-gfx mailing list