diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-21 08:34:04 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-21 08:39:15 +0100 |
commit | 85d6566c4e61348e4c9ede606c4937912f62e652 (patch) | |
tree | 67bb9f508e5d2e7d9847094394701b59c8b8a38e | |
parent | 5b558c58a5d72710e1ace61c35f022fc8e3146de (diff) |
igt/gem_close_race: Complete conversion to drm_open_driver()
commit e63a0681d95a ("tests/gem_close_race: Use drm_open_driver helper")
left a few raw open() behind. Eliminate them as well!
References: https://bugs.freedesktop.org/show_bug.cgi?id=96605
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_close_race.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/gem_close_race.c b/tests/gem_close_race.c index 6458505d..5edb3441 100644 --- a/tests/gem_close_race.c +++ b/tests/gem_close_race.c @@ -48,7 +48,6 @@ #define BLT_WRITE_ALPHA (1<<21) #define BLT_WRITE_RGB (1<<20) -static char device[80]; static uint32_t devid; static bool has_64bit_relocations; @@ -145,8 +144,7 @@ static void process(int child) uint32_t handle; int fd; - fd = open(device, O_RDWR); - igt_assert_neq(fd, -1); + fd = drm_open_driver(DRIVER_INTEL); handle = load(fd); if ((child & 63) == 63) @@ -184,11 +182,11 @@ static void threads(int timeout) sev.sigev_signo = SIGRTMIN; igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0); - fd = open(device, O_RDWR); + fd = drm_open_driver(DRIVER_INTEL); name.name = gem_flink(fd, gem_create(fd, OBJECT_SIZE)); igt_until_timeout(timeout) { - crashme.fd = open(device, O_RDWR); + crashme.fd = drm_open_driver(DRIVER_INTEL); memset(&its, 0, sizeof(its)); its.it_value.tv_nsec = msec(1) + (rand() % msec(10)); @@ -201,6 +199,8 @@ static void threads(int timeout) selfcopy(crashme.fd, name.handle, 100); drmIoctl(crashme.fd, DRM_IOCTL_GEM_CLOSE, &name.handle); } while (1); + + close(crashme.fd); } timer_delete(timer); |