public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] i915/gem_exec_big: Sync against asynchronous relocations
@ 2019-08-27 14:58 Chris Wilson
  2019-08-27 15:46 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Wilson @ 2019-08-27 14:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

If we are writing the relocations using the GPU they will not be written
into the batch immediately. Instead there will be a write-fence while
the relocation is being performed, giving us something to conveniently
wait upon.

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

diff --git a/tests/i915/gem_exec_big.c b/tests/i915/gem_exec_big.c
index 9da90ead6..c06ee9959 100644
--- a/tests/i915/gem_exec_big.c
+++ b/tests/i915/gem_exec_big.c
@@ -95,6 +95,7 @@ static void exec1(int fd, uint32_t handle, uint64_t reloc_ofs, unsigned flags, c
 	gem_execbuf(fd, &execbuf);
 
 	igt_warn_on(gem_reloc[0].presumed_offset == -1);
+	gem_set_domain(fd, gem_exec[0].handle, I915_GEM_DOMAIN_WC, 0);
 
 	if (use_64bit_relocs) {
 		uint64_t tmp;
@@ -102,14 +103,14 @@ static void exec1(int fd, uint32_t handle, uint64_t reloc_ofs, unsigned flags, c
 			tmp = *(uint64_t *)(ptr+reloc_ofs);
 		else
 			gem_read(fd, handle, reloc_ofs, &tmp, sizeof(tmp));
-		igt_assert_eq(tmp, gem_reloc[0].presumed_offset);
+		igt_assert_eq_u64(tmp, gem_reloc[0].presumed_offset);
 	} else {
 		uint32_t tmp;
 		if (ptr)
 			tmp = *(uint32_t *)(ptr+reloc_ofs);
 		else
 			gem_read(fd, handle, reloc_ofs, &tmp, sizeof(tmp));
-		igt_assert_eq(tmp, gem_reloc[0].presumed_offset);
+		igt_assert_eq_u32(tmp, gem_reloc[0].presumed_offset);
 	}
 }
 
@@ -173,6 +174,7 @@ static void execN(int fd, uint32_t handle, uint64_t batch_size, unsigned flags,
 		if (igt_warn_on(gem_reloc[n].presumed_offset == -1))
 			break;
 	}
+	gem_set_domain(fd, gem_exec[0].handle, I915_GEM_DOMAIN_WC, 0);
 
 	if (use_64bit_relocs) {
 		for (n = 0; n < nreloc; n++) {
@@ -181,7 +183,7 @@ static void execN(int fd, uint32_t handle, uint64_t batch_size, unsigned flags,
 				tmp = *(uint64_t *)(ptr+reloc_ofs(n, nreloc));
 			else
 				gem_read(fd, handle, reloc_ofs(n, nreloc), &tmp, sizeof(tmp));
-			igt_assert_eq(tmp, gem_reloc[n].presumed_offset);
+			igt_assert_eq_u64(tmp, gem_reloc[n].presumed_offset);
 		}
 	} else {
 		for (n = 0; n < nreloc; n++) {
@@ -190,7 +192,7 @@ static void execN(int fd, uint32_t handle, uint64_t batch_size, unsigned flags,
 				tmp = *(uint32_t *)(ptr+reloc_ofs(n, nreloc));
 			else
 				gem_read(fd, handle, reloc_ofs(n, nreloc), &tmp, sizeof(tmp));
-			igt_assert_eq(tmp, gem_reloc[n].presumed_offset);
+			igt_assert_eq_u32(tmp, gem_reloc[n].presumed_offset);
 		}
 	}
 
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2019-08-28 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-27 14:58 [Intel-gfx] [PATCH i-g-t] i915/gem_exec_big: Sync against asynchronous relocations Chris Wilson
2019-08-27 15:46 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-08-28 13:34 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-08-28 15:57 ` [igt-dev] [Intel-gfx] [PATCH i-g-t] " Matthew Auld

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