summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-07-11 10:40:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-07-11 10:43:53 +0100
commitb793b4b40e42300f165dd3fdd670c2a85bd657c6 (patch)
treed3eb3050e6b34b68ca3fb617b83da866b80d0e9b /tests
parent8a50ca9985d2dbb0293186c3286af46468fb4b84 (diff)
i915/gem_userptr_blits: Reduce readonly test runtime
We do a lot of randomised passes to look for the same mistake. If the first worked, the likelihood of any of the later attempts failing is miniscule. Instead, lets use the repeated passed over many CI_DRM to do the thorough testing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/i915/gem_userptr_blits.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index db41882db..268423dcd 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -1196,6 +1196,7 @@ static void test_readonly(int i915)
{
uint64_t aperture_size;
uint32_t whandle, rhandle;
+ struct timespec tv;
size_t sz, total;
void *pages, *space;
int memfd;
@@ -1230,6 +1231,7 @@ static void test_readonly(int i915)
* the target address for MI_STORE_DWORD_IMM, so our maximum
* usable object size is only 2GiB. For now.
*/
+ igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
total = 2048ull << 20;
aperture_size = gem_aperture_size(i915) / 2;
if (aperture_size < total)
@@ -1250,16 +1252,18 @@ static void test_readonly(int i915)
igt_assert_eq_u32(*(uint32_t *)pages, (uint32_t)(total - sz));
igt_assert(mlock(pages, sz) == 0);
close(memfd);
+ igt_info("Arena creation in %.1fms\n", igt_nsec_elapsed(&tv) * 1e-6);
/* Check we can create a normal userptr bo wrapping the wrapper */
+ igt_nsec_elapsed(memset(&tv, 0, sizeof(tv)));
gem_userptr(i915, space, total, false, userptr_flags, &rhandle);
gem_set_domain(i915, rhandle, I915_GEM_DOMAIN_CPU, 0);
- for (size_t offset = 0; offset < total; offset += sz)
- store_dword(i915, rhandle, offset + 4, offset / sz);
+ store_dword(i915, rhandle, total - sz + 4, total / sz);
gem_sync(i915, rhandle);
igt_assert_eq_u32(*(uint32_t *)(pages + 0), (uint32_t)(total - sz));
- igt_assert_eq_u32(*(uint32_t *)(pages + 4), (uint32_t)(total / sz - 1));
+ igt_assert_eq_u32(*(uint32_t *)(pages + 4), (uint32_t)(total / sz));
gem_close(i915, rhandle);
+ igt_info("Sanity check took %.1fms\n", igt_nsec_elapsed(&tv) * 1e-6);
/* Now enforce read-only henceforth */
igt_assert(mprotect(space, total, PROT_READ) == 0);
@@ -1275,7 +1279,7 @@ static void test_readonly(int i915)
char *ref, *result;
/* First tweak the backing store through the write */
- store_dword_rand(i915, eb_ring(e), whandle, sz, 1024);
+ store_dword_rand(i915, eb_ring(e), whandle, sz, 64);
gem_sync(i915, whandle);
ref = g_compute_checksum_for_data(G_CHECKSUM_SHA1,
pages, sz);
@@ -1284,7 +1288,7 @@ static void test_readonly(int i915)
igt_assert(strcmp(ref, orig));
/* Now try the same through the read-only handle */
- store_dword_rand(i915, eb_ring(e), rhandle, total, 1024);
+ store_dword_rand(i915, eb_ring(e), rhandle, total, 64);
gem_sync(i915, rhandle);
result = g_compute_checksum_for_data(G_CHECKSUM_SHA1,
pages, sz);