diff mbox

drm/i915: Timeout lowlevel_hole GTT selftest early

Message ID 20170224193315.21072-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Feb. 24, 2017, 7:33 p.m. UTC
Check for a timeout in the lowlevel_hole GTT before we allocate state
for that pass, as our cleanup phase stops on the iteration before the
timeout.

References: https://bugs.freedesktop.org/show_bug.cgi?id=99947
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Matthew Auld Feb. 24, 2017, 8:12 p.m. UTC | #1
On 24 February 2017 at 19:33, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Check for a timeout in the lowlevel_hole GTT before we allocate state
> for that pass, as our cleanup phase stops on the iteration before the
> timeout.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=99947
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index e23753181720..6bac267914df 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -237,18 +237,19 @@  static int lowlevel_hole(struct drm_i915_private *i915,
 
 			GEM_BUG_ON(addr + BIT_ULL(size) > vm->total);
 
+			if (igt_timeout(end_time,
+					"%s timed out before %d/%d\n",
+					__func__, n, count)) {
+				hole_end = hole_start; /* quit */
+				break;
+			}
+
 			if (vm->allocate_va_range &&
 			    vm->allocate_va_range(vm, addr, BIT_ULL(size)))
 				break;
 
 			vm->insert_entries(vm, obj->mm.pages, addr,
 					   I915_CACHE_NONE, 0);
-			if (igt_timeout(end_time,
-					"%s timed out after %d/%d\n",
-					__func__, n, count)) {
-				hole_end = hole_start; /* quit */
-				break;
-			}
 		}
 		count = n;