public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_softpin: Replace constant loop with timeout
@ 2019-10-05  8:15 Chris Wilson
  2019-10-05  9:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  2019-10-07 16:58 ` [Intel-gfx] [igt-dev] [PATCH i-g-t] " Tvrtko Ursulin
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2019-10-05  8:15 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Rather than do a fixed amount of work that takes *forever*, run for a
fixed amount of time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_softpin.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index c29097ad3..032056c08 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -102,14 +102,14 @@ static void test_softpin(int fd)
 	struct drm_i915_gem_exec_object2 object;
 	uint64_t offset, end;
 	uint32_t last_handle;
-	int loop;
+	unsigned long count = 0;
 
 	last_handle = gem_create(fd, size);
 
 	memset(&execbuf, 0, sizeof(execbuf));
 	execbuf.buffers_ptr = to_user_pointer(&object);
 	execbuf.buffer_count = 1;
-	for (loop = 0; loop < 1024; loop++) {
+	igt_until_timeout(30) {
 		memset(&object, 0, sizeof(object));
 		object.handle = gem_create(fd, 2*size);
 		gem_write(fd, object.handle, 0, &bbe, sizeof(bbe));
@@ -134,7 +134,9 @@ static void test_softpin(int fd)
 		}
 
 		last_handle = object.handle;
+		count++;
 	}
+	igt_info("Completd %lu cycles\n", count);
 }
 
 static void test_overlap(int fd)
-- 
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-07 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-05  8:15 [igt-dev] [PATCH i-g-t] i915/gem_softpin: Replace constant loop with timeout Chris Wilson
2019-10-05  9:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2019-10-07 16:58 ` [Intel-gfx] [igt-dev] [PATCH i-g-t] " Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox