From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH i-g-t v2 2/3] tests/gem_exec_fence: Exclude 0 from use in store batches Date: Fri, 5 Aug 2022 16:27:15 +0200 [thread overview] Message-ID: <20220805142716.185077-2-janusz.krzysztofik@linux.intel.com> (raw) In-Reply-To: <20220805142716.185077-1-janusz.krzysztofik@linux.intel.com> When i = 0, condition out[i] == i will be true even if a batch supposed to store i in out[i] fails. Don't use i = 0 in batches that store values in out[i]. v2: still check for out[0] == 0 (Chris) Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> --- tests/i915/gem_exec_fence.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/i915/gem_exec_fence.c b/tests/i915/gem_exec_fence.c index 048870053a..78d83460f7 100644 --- a/tests/i915/gem_exec_fence.c +++ b/tests/i915/gem_exec_fence.c @@ -334,6 +334,8 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, if (!gem_class_can_store_dword(fd, e2->class)) continue; + i++; + if (flags & NONBLOCK) { igt_store_word(fd, ahnd, ctx, e2, spin->out_fence, scratch, scratch_offset, i, i); @@ -345,8 +347,6 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, put_ahnd(ahnd); } } - - i++; } igt_spin_busywait_until_started(spin); @@ -356,7 +356,7 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, if ((flags & HANG) == 0) { /* Check for invalidly completing the task early */ igt_assert(fence_busy(spin->out_fence)); - for (int n = 0; n < i; n++) + for (int n = 0; n <= i; n++) igt_assert_eq_u32(out[n], 0); igt_spin_end(spin); @@ -366,8 +366,11 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, gem_set_domain(fd, scratch, I915_GEM_DOMAIN_GTT, 0); igt_assert(!fence_busy(spin->out_fence)); - while ((flags & HANG) == 0 && i--) - igt_assert_eq_u32(out[i], i); + if ((flags & HANG) == 0) { + do + igt_assert_eq_u32(out[i], i); + while (i--); + } munmap(out, 4096); igt_spin_free(fd, spin); -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk> Subject: [igt-dev] [PATCH i-g-t v2 2/3] tests/gem_exec_fence: Exclude 0 from use in store batches Date: Fri, 5 Aug 2022 16:27:15 +0200 [thread overview] Message-ID: <20220805142716.185077-2-janusz.krzysztofik@linux.intel.com> (raw) In-Reply-To: <20220805142716.185077-1-janusz.krzysztofik@linux.intel.com> When i = 0, condition out[i] == i will be true even if a batch supposed to store i in out[i] fails. Don't use i = 0 in batches that store values in out[i]. v2: still check for out[0] == 0 (Chris) Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> --- tests/i915/gem_exec_fence.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/i915/gem_exec_fence.c b/tests/i915/gem_exec_fence.c index 048870053a..78d83460f7 100644 --- a/tests/i915/gem_exec_fence.c +++ b/tests/i915/gem_exec_fence.c @@ -334,6 +334,8 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, if (!gem_class_can_store_dword(fd, e2->class)) continue; + i++; + if (flags & NONBLOCK) { igt_store_word(fd, ahnd, ctx, e2, spin->out_fence, scratch, scratch_offset, i, i); @@ -345,8 +347,6 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, put_ahnd(ahnd); } } - - i++; } igt_spin_busywait_until_started(spin); @@ -356,7 +356,7 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, if ((flags & HANG) == 0) { /* Check for invalidly completing the task early */ igt_assert(fence_busy(spin->out_fence)); - for (int n = 0; n < i; n++) + for (int n = 0; n <= i; n++) igt_assert_eq_u32(out[n], 0); igt_spin_end(spin); @@ -366,8 +366,11 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, gem_set_domain(fd, scratch, I915_GEM_DOMAIN_GTT, 0); igt_assert(!fence_busy(spin->out_fence)); - while ((flags & HANG) == 0 && i--) - igt_assert_eq_u32(out[i], i); + if ((flags & HANG) == 0) { + do + igt_assert_eq_u32(out[i], i); + while (i--); + } munmap(out, 4096); igt_spin_free(fd, spin); -- 2.25.1
next prev parent reply other threads:[~2022-08-05 14:28 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-08-05 14:27 [Intel-gfx] [PATCH i-g-t 1/3] tests/gem_exec_fence: Fix wrong engine checked for store_dword capability Janusz Krzysztofik 2022-08-05 14:27 ` [igt-dev] " Janusz Krzysztofik 2022-08-05 14:27 ` Janusz Krzysztofik [this message] 2022-08-05 14:27 ` [igt-dev] [PATCH i-g-t v2 2/3] tests/gem_exec_fence: Exclude 0 from use in store batches Janusz Krzysztofik 2022-08-05 14:27 ` [Intel-gfx] [PATCH i-g-t v2 3/3] tests/gem_exec_fence: Restore pre-hang checks in *await-hang scenarios Janusz Krzysztofik 2022-08-05 14:27 ` [igt-dev] " Janusz Krzysztofik 2022-08-05 15:32 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] tests/gem_exec_fence: Fix wrong engine checked for store_dword capability Patchwork 2022-08-05 23:46 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 2022-08-08 16:16 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork 2022-08-12 9:53 [Intel-gfx] [PATCH i-g-t 1/3] " Janusz Krzysztofik 2022-08-12 9:53 ` [Intel-gfx] [PATCH i-g-t v2 2/3] tests/gem_exec_fence: Exclude 0 from use in store batches Janusz Krzysztofik 2022-08-17 12:55 ` Mauro Carvalho Chehab
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=20220805142716.185077-2-janusz.krzysztofik@linux.intel.com \ --to=janusz.krzysztofik@linux.intel.com \ --cc=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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.