summaryrefslogtreecommitdiff
path: root/tests/gem_evict_alignment.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-08-15 11:27:46 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-09-11 12:58:48 +0100
commitf9e0154630766b63617c64255a68e5129e233a4b (patch)
treeff443b26dd11b4dddb51703739e9e25b054995af /tests/gem_evict_alignment.c
parent4f082c35d2df545f81d202ae1a08463f6c123552 (diff)
igt/gem_evict_(alignment,everything): Limit to low 4G
These tests do not tell the kernel they can use the upper 48bits of aperture space, and cause eviction on the low 4G just as effectively exercising the evict code. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/gem_evict_alignment.c')
-rw-r--r--tests/gem_evict_alignment.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/tests/gem_evict_alignment.c b/tests/gem_evict_alignment.c
index a5dfd0d9..239be728 100644
--- a/tests/gem_evict_alignment.c
+++ b/tests/gem_evict_alignment.c
@@ -188,6 +188,8 @@ static void major_evictions(int fd, uint64_t size, uint64_t count)
free(bo);
}
+#define MAX_32b ((1ull << 32) - 4096)
+
igt_main
{
uint64_t size, count;
@@ -196,29 +198,46 @@ igt_main
igt_fixture {
fd = drm_open_driver(DRIVER_INTEL);
igt_require_gem(fd);
+ igt_fork_hang_detector(fd);
}
igt_subtest("minor-normal") {
size = 1024 * 1024;
- count = 3*gem_aperture_size(fd) / size / 4;
+ count = gem_aperture_size(fd);
+ if (count >> 32)
+ count = MAX_32b;
+ count = 3 * count / size / 4;
minor_evictions(fd, size, count);
}
igt_subtest("major-normal") {
- size = 3*gem_aperture_size(fd) / 4;
+ size = gem_aperture_size(fd);
+ if (size >> 32)
+ size = MAX_32b;
+ size = 3 * size / 4;
count = 4;
major_evictions(fd, size, count);
}
+ igt_fixture {
+ igt_stop_hang_detector();
+ }
+
igt_fork_signal_helper();
igt_subtest("minor-interruptible") {
size = 1024 * 1024;
- count = 3*gem_aperture_size(fd) / size / 4;
+ count = gem_aperture_size(fd);
+ if (count >> 32)
+ count = MAX_32b;
+ count = 3 * count / size / 4;
minor_evictions(fd, size, count);
}
igt_subtest("major-interruptible") {
- size = 3*gem_aperture_size(fd) / 4;
+ size = gem_aperture_size(fd);
+ if (size >> 32)
+ size = MAX_32b;
+ size = 3 * size / 4;
count = 4;
major_evictions(fd, size, count);
}
@@ -226,12 +245,18 @@ igt_main
igt_subtest("minor-hang") {
igt_fork_hang_helper();
size = 1024 * 1024;
- count = 3*gem_aperture_size(fd) / size / 4;
+ count = gem_aperture_size(fd);
+ if (count >> 32)
+ count = MAX_32b;
+ count = 3 * count / size / 4;
minor_evictions(fd, size, count);
}
igt_subtest("major-hang") {
- size = 3*gem_aperture_size(fd) / 4;
+ size = gem_aperture_size(fd);
+ if (size >> 32)
+ size = MAX_32b;
+ size = 3 * size / 4;
count = 4;
major_evictions(fd, size, count);
}