summaryrefslogtreecommitdiff
path: root/tests/gem_close_race.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-04-22 16:37:35 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-04-22 16:46:15 +0100
commit2f859537b59907a3e0a082c1cb6f6dfb8e99b616 (patch)
treecf1c3ef215ee6f8395c97a0d786cb55a057cbc2c /tests/gem_close_race.c
parent757b9be460e06c8466f6c49ab7f0d7ff234b5b54 (diff)
igt/gem_close_race: Import the scratch
Rather than create a new scratch buffer every pass, import the original as this provides stress upon less commonly trod paths (i.e. handling objects with many vma) as well as many objects in general. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_close_race.c')
-rw-r--r--tests/gem_close_race.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/tests/gem_close_race.c b/tests/gem_close_race.c
index e6537c3b..9cfdbf3f 100644
--- a/tests/gem_close_race.c
+++ b/tests/gem_close_race.c
@@ -169,8 +169,10 @@ static void threads(int timeout)
{
struct sigevent sev;
struct sigaction act;
+ struct drm_gem_open name;
struct itimerspec its;
timer_t timer;
+ int fd;
memset(&act, 0, sizeof(act));
act.sa_handler = crashme_now;
@@ -182,8 +184,9 @@ static void threads(int timeout)
sev.sigev_signo = SIGRTMIN;
igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0);
+ fd = open(device, O_RDWR);
+ name.name = gem_flink(fd, gem_create(fd, OBJECT_SIZE));
- int count = 0;
igt_timeout(timeout) {
crashme.fd = open(device, O_RDWR);
@@ -192,24 +195,16 @@ static void threads(int timeout)
igt_assert(timer_settime(timer, 0, &its, NULL) == 0);
do {
- struct drm_i915_gem_create create;
-
- count++;
- memset(&create, 0, sizeof(create));
- create.handle = 0;
- create.size = 4096;
- drmIoctl(crashme.fd, DRM_IOCTL_I915_GEM_CREATE, &create);
-
- selfcopy(crashme.fd, create.handle, 100);
-
- if (drmIoctl(crashme.fd, DRM_IOCTL_GEM_CLOSE, &create.handle))
+ if (drmIoctl(crashme.fd, DRM_IOCTL_GEM_OPEN, &name))
break;
- } while (1);
+ selfcopy(crashme.fd, name.handle, 100);
+ drmIoctl(crashme.fd, DRM_IOCTL_GEM_CLOSE, &name.handle);
+ } while (1);
}
- printf("count = %d\n", count);
timer_delete(timer);
+ close(fd);
}
igt_main
@@ -246,7 +241,7 @@ igt_main
}
igt_subtest("gem-close-race")
- threads(120);
+ threads(150);
igt_stop_hang_detector();
}