diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-05-05 12:34:03 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-05-07 14:19:37 +0100 |
commit | ce0ec5c84bb4beaf578d96ea50c90d798aee11cd (patch) | |
tree | ae8f4c0640ebdb714c86831c0613170c8f7548df /lib/ioctl_wrappers.c | |
parent | 50868ab3c532a86aa147fb555b69a1078c572b13 (diff) |
lib/i915: Split igt_require_gem() into i915/
igt_require_gem() is a pecularity of i915/, move it out of the core.
Similar opportunistic move of gem_reopen_driver() and
gem_quiescent_gpu().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/ioctl_wrappers.c')
-rw-r--r-- | lib/ioctl_wrappers.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 25d04b3e..61f93bd8 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -1158,55 +1158,6 @@ void gem_require_caching(int fd) errno = 0; } -static void reset_device(int fd) -{ - int dir; - - dir = igt_debugfs_dir(fd); - igt_require(dir >= 0); - - if (ioctl(fd, DRM_IOCTL_I915_GEM_THROTTLE)) { - igt_info("Found wedged device, trying to reset and continue\n"); - igt_sysfs_set(dir, "i915_wedged", "-1"); - } - igt_sysfs_set(dir, "i915_next_seqno", "1"); - - close(dir); -} - -void igt_require_gem(int fd) -{ - char path[256]; - int err; - - igt_require_intel(fd); - - /* - * We only want to use the throttle-ioctl for its -EIO reporting - * of a wedged device, not for actually waiting on outstanding - * requests! So create a new drm_file for the device that is clean. - */ - snprintf(path, sizeof(path), "/proc/self/fd/%d", fd); - fd = open(path, O_RDWR); - igt_assert_lte(0, fd); - - /* - * Reset the global seqno at the start of each test. This ensures that - * the test will not wrap unless it explicitly sets up seqno wrapping - * itself, which avoids accidentally hanging when setting up long - * sequences of batches. - */ - reset_device(fd); - - err = 0; - if (ioctl(fd, DRM_IOCTL_I915_GEM_THROTTLE)) - err = -errno; - - close(fd); - - igt_require_f(err == 0, "Unresponsive i915/GEM device\n"); -} - /** * gem_require_ring: * @fd: open i915 drm file descriptor |