public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_exec_whipser: Pass early exit onto check_bo
@ 2019-01-14 16:34 Chris Wilson
  2019-01-14 17:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2019-01-14 16:34 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

If we break out of the test loop early, we may not have filled all
dwords, so be careful to only check as far as we completed.

Fixes: d9cd03c887a5 ("i915/gem_exec_whisper: Limit to a maximum of 150s")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_exec_whisper.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/i915/gem_exec_whisper.c b/tests/i915/gem_exec_whisper.c
index 277b678c4..0b15fe431 100644
--- a/tests/i915/gem_exec_whisper.c
+++ b/tests/i915/gem_exec_whisper.c
@@ -52,15 +52,14 @@ static void write_seqno(int dir, unsigned offset)
 	igt_debug("next seqno set to: 0x%x\n", seqno);
 }
 
-static void check_bo(int fd, uint32_t handle)
+static void check_bo(int fd, uint32_t handle, int pass)
 {
 	uint32_t *map;
-	int i;
 
 	igt_debug("Verifying result\n");
 	map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_READ);
 	gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, 0);
-	for (i = 0; i < 1024; i++)
+	for (int i = 0; i < pass; i++)
 		igt_assert_eq(map[i], i);
 	munmap(map, 4096);
 }
@@ -228,6 +227,8 @@ static void whisper(int fd, unsigned engine, unsigned flags)
 
 	intel_detect_and_clear_missed_interrupts(fd);
 	igt_fork(child, flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1)  {
+		unsigned int pass;
+
 		memset(&scratch, 0, sizeof(scratch));
 		scratch.handle = gem_create(fd, 4096);
 		scratch.flags = EXEC_OBJECT_WRITE;
@@ -323,8 +324,7 @@ static void whisper(int fd, unsigned engine, unsigned flags)
 		}
 
 		igt_while_interruptible(flags & INTERRUPTIBLE) {
-			unsigned int pass = 0;
-
+			pass = 0;
 			igt_until_timeout(150) {
 				uint64_t offset;
 
@@ -473,7 +473,7 @@ static void whisper(int fd, unsigned engine, unsigned flags)
 		igt_info("Number of migrations for execbuf: %d\n", eb_migrations);
 		igt_info("Number of migrations for reloc: %d, interrupted %d, patched %d\n", reloc_migrations, reloc_interruptions, relocations);
 
-		check_bo(fd, scratch.handle);
+		check_bo(fd, scratch.handle, pass);
 		gem_close(fd, scratch.handle);
 		gem_close(fd, store.handle);
 
-- 
2.20.1

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

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

end of thread, other threads:[~2019-01-14 22:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-14 16:34 [igt-dev] [PATCH i-g-t] i915/gem_exec_whipser: Pass early exit onto check_bo Chris Wilson
2019-01-14 17:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-01-14 17:43 ` [Intel-gfx] [PATCH i-g-t] " Tvrtko Ursulin
2019-01-14 17:45   ` [igt-dev] " Chris Wilson
2019-01-14 22:46 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

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