tests/gem_evict_*: Add interruptible modes

Also I've stumbled over igt_fixture again. Somehow gcc loves to wreak
havoc with stack variables set up in igt_fixtures ... Duct-tape in the
form of moving fd out to global scope applied.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter
2013-08-23 22:32:29 +02:00
parent 1b6480114e
commit 09d9089ead
3 changed files with 74 additions and 22 deletions
+35 -10
View File
@@ -175,22 +175,47 @@ static void major_evictions(int fd, int size, int count)
free(bo);
}
int fd;
int main(int argc, char **argv)
{
int fd, size, count;
int size, count;
igt_subtest_init(argc, argv);
igt_skip_on_simulation();
fd = drm_open_any();
igt_fixture
fd = drm_open_any();
size = 1024 * 1024;
count = 3*gem_aperture_size(fd) / size / 4;
minor_evictions(fd, size, count);
igt_subtest("minor-normal") {
size = 1024 * 1024;
count = 3*gem_aperture_size(fd) / size / 4;
minor_evictions(fd, size, count);
}
size = 3*gem_aperture_size(fd) / 4;
count = 4;
major_evictions(fd, size, count);
igt_subtest("major-normal") {
size = 3*gem_aperture_size(fd) / 4;
count = 4;
major_evictions(fd, size, count);
}
close(fd);
return 0;
igt_fork_signal_helper();
igt_subtest("minor-interruptible") {
size = 1024 * 1024;
count = 3*gem_aperture_size(fd) / size / 4;
minor_evictions(fd, size, count);
}
igt_subtest("major-interruptible") {
size = 3*gem_aperture_size(fd) / 4;
count = 4;
major_evictions(fd, size, count);
}
igt_stop_signal_helper();
igt_fixture
close(fd);
igt_exit();
}