diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-08-29 21:25:14 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-08-29 21:25:14 +0100 |
commit | 255bade1ea98e642fe6d01c9dee8d5e8661bd816 (patch) | |
tree | ea7872222dbb5cb92a1d156276a35b305266443d | |
parent | 982f7eb238a0898c456e0574dee7c4507738d75f (diff) | |
download | intel-gpu-tools-255bade1ea98e642fe6d01c9dee8d5e8661bd816.tar.gz intel-gpu-tools-255bade1ea98e642fe6d01c9dee8d5e8661bd816.tar.bz2 intel-gpu-tools-255bade1ea98e642fe6d01c9dee8d5e8661bd816.zip |
igt/gem_seqno_wrap: Use debugfs singleton
This has the added advantage of automounting debugfs for us.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_seqno_wrap.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c index 3a408608..e8528ec6 100644 --- a/tests/gem_seqno_wrap.c +++ b/tests/gem_seqno_wrap.c @@ -45,6 +45,7 @@ #include "drmtest.h" #include "igt_core.h" #include "igt_aux.h" +#include "igt_debugfs.h" #include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_io.h" @@ -277,23 +278,6 @@ static void run_sync_test(int num_buffers, bool verify) close(fd); } -static const char *dfs_base = "/sys/kernel/debug/dri"; -static const char *dfs_entry = "i915_next_seqno"; - -static int dfs_open(int mode) -{ - char fname[FILENAME_MAX]; - int fh; - - snprintf(fname, FILENAME_MAX, "%s/%i/%s", - dfs_base, card_index, dfs_entry); - - fh = open(fname, mode); - igt_require(fh >= 0); - - return fh; -} - static int __read_seqno(uint32_t *seqno) { int fh; @@ -302,7 +286,7 @@ static int __read_seqno(uint32_t *seqno) char *p; unsigned long int tmp; - fh = dfs_open(O_RDONLY); + fh = igt_debugfs_open("i915_next_seqno", O_RDONLY); r = read(fh, buf, sizeof(buf) - 1); close(fh); @@ -358,7 +342,7 @@ static int write_seqno(uint32_t seqno) if (options.dontwrap) return 0; - fh = dfs_open(O_RDWR); + fh = igt_debugfs_open("i915_next_seqno", O_RDWR); igt_assert(snprintf(buf, sizeof(buf), "0x%x", seqno) > 0); r = write(fh, buf, strnlen(buf, sizeof(buf))); |