diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ioctl_wrappers.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 118dcefe..39e8469e 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -52,6 +52,7 @@ #include "intel_chipset.h" #include "intel_io.h" #include "igt_debugfs.h" +#include "igt_sysfs.h" #include "config.h" #ifdef HAVE_VALGRIND @@ -1411,7 +1412,8 @@ void igt_require_gem(int fd) igt_require_intel(fd); - /* We only want to use the throttle-ioctl for its -EIO reporting + /* + * 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. */ @@ -1419,6 +1421,18 @@ void igt_require_gem(int 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. + */ + err = igt_debugfs_dir(fd); + if (err != -1) { + igt_sysfs_printf(err, "i915_next_seqno", "1"); + close(err); + } + err = 0; if (ioctl(fd, DRM_IOCTL_I915_GEM_THROTTLE)) err = -errno; |