public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH i-g-t] i915/gem_exec_big: Sync against asynchronous relocations
Date: Tue, 27 Aug 2019 15:58:31 +0100	[thread overview]
Message-ID: <20190827145831.382-1-chris@chris-wilson.co.uk> (raw)

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

             reply	other threads:[~2019-08-27 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 14:58 Chris Wilson [this message]
2019-08-27 15:46 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_exec_big: Sync against asynchronous relocations 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190827145831.382-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox