From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] sw_sync: Use fixed runtime for sync_expired_merge
Date: Thu, 20 Feb 2020 16:57:21 +0000 [thread overview]
Message-ID: <20200220165721.2056191-1-chris@chris-wilson.co.uk> (raw)
Convert from using a fixed number of iterations (1 million), to using a
fixed runtime so that we have predictable (and shorter!) run times across
a wide variety of machines.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Martin Peres <martin.peres@linux.intel.com>
---
tests/sw_sync.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/tests/sw_sync.c b/tests/sw_sync.c
index 626b6d39f..6e439496d 100644
--- a/tests/sw_sync.c
+++ b/tests/sw_sync.c
@@ -747,30 +747,27 @@ static void test_sync_multi_producer_single_consumer(void)
static void test_sync_expired_merge(void)
{
- int iterations = 1 << 20;
int timeline;
- int i;
- int fence_expired, fence_merged;
+ int expired;
timeline = sw_sync_timeline_create();
sw_sync_timeline_inc(timeline, 100);
- fence_expired = sw_sync_timeline_create_fence(timeline, 1);
- igt_assert_f(sync_fence_wait(fence_expired, 0) == 0,
+ expired = sw_sync_timeline_create_fence(timeline, 1);
+ igt_assert_f(sync_fence_wait(expired, 0) == 0,
"Failure waiting for expired fence\n");
- fence_merged = sync_fence_merge(fence_expired, fence_expired);
- close(fence_merged);
+ close(sync_fence_merge(expired, expired));
- for (i = 0; i < iterations; i++) {
- int fence = sync_fence_merge(fence_expired, fence_expired);
+ igt_until_timeout(2) {
+ int fence = sync_fence_merge(expired, expired);
igt_assert_f(sync_fence_wait(fence, -1) == 0,
"Failure waiting on fence\n");
close(fence);
}
- close(fence_expired);
+ close(expired);
}
static void test_sync_random_merge(void)
--
2.25.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2020-02-20 16:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 16:57 Chris Wilson [this message]
2020-02-20 19:09 ` [igt-dev] ✓ Fi.CI.BAT: success for sw_sync: Use fixed runtime for sync_expired_merge Patchwork
2020-02-21 7:24 ` [igt-dev] [PATCH i-g-t] " Martin Peres
2020-02-23 2:09 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
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=20200220165721.2056191-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