diff options
Diffstat (limited to 'lib/i915')
-rw-r--r-- | lib/i915/gem.c | 20 | ||||
-rw-r--r-- | lib/i915/gem.h | 2 | ||||
-rw-r--r-- | lib/i915/gem_ring.c | 2 | ||||
-rw-r--r-- | lib/i915/gem_submission.c | 4 |
4 files changed, 4 insertions, 24 deletions
diff --git a/lib/i915/gem.c b/lib/i915/gem.c index ed45a9ed5..6da3e5c93 100644 --- a/lib/i915/gem.c +++ b/lib/i915/gem.c @@ -147,7 +147,7 @@ void igt_require_gem(int i915) * of a wedged device, not for actually waiting on outstanding * requests! So create a new drm_file for the device that is clean. */ - i915 = gem_reopen_driver(i915); + i915 = drm_reopen_driver(i915); /* * Reset the global seqno at the start of each test. This ensures that @@ -189,21 +189,3 @@ void gem_quiescent_gpu(int i915) igt_drop_caches_set(i915, DROP_ACTIVE | DROP_RETIRE | DROP_IDLE | DROP_FREED); } - -/** - * gem_reopen_driver: - * @i915: re-open the i915 drm file descriptor - * - * Re-opens the drm fd which is useful in instances where a clean default - * context is needed. - */ -int gem_reopen_driver(int i915) -{ - char path[256]; - - snprintf(path, sizeof(path), "/proc/self/fd/%d", i915); - i915 = open(path, O_RDWR); - igt_assert_fd(i915); - - return i915; -} diff --git a/lib/i915/gem.h b/lib/i915/gem.h index feabac8df..06dcb5468 100644 --- a/lib/i915/gem.h +++ b/lib/i915/gem.h @@ -30,6 +30,4 @@ void igt_require_gem(int i915); void gem_quiescent_gpu(int i915); -int gem_reopen_driver(int i915); - #endif /* I915_GEM_H */ diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c index 6d28b5d96..eb2c7c2c9 100644 --- a/lib/i915/gem_ring.c +++ b/lib/i915/gem_ring.c @@ -149,7 +149,7 @@ gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags f { unsigned int min = ~0u; - fd = gem_reopen_driver(fd); + fd = drm_reopen_driver(fd); /* When available, disable execbuf throttling */ fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_NONBLOCK); diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c index 0358802ef..adf5eb394 100644 --- a/lib/i915/gem_submission.c +++ b/lib/i915/gem_submission.c @@ -30,7 +30,6 @@ #include <i915_drm.h> -#include "i915/gem.h" #include "i915/gem_create.h" #include "i915/gem_engine_topology.h" #include "i915/gem_submission.h" @@ -42,6 +41,7 @@ #include "intel_chipset.h" #include "intel_reg.h" #include "ioctl_wrappers.h" +#include "drmtest.h" /** * SECTION:gem_submission @@ -158,7 +158,7 @@ void gem_test_all_engines(int i915) }; const intel_ctx_t *ctx; - i915 = gem_reopen_driver(i915); + i915 = drm_reopen_driver(i915); igt_assert(!is_wedged(i915)); ctx = intel_ctx_create_all_physical(i915); |