summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-04-12 16:50:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-04-12 16:53:09 +0100
commit30769516984f404a54a60e7815a20de2a88b8d2a (patch)
tree8334a49d7797e5414121883a556405d85ae6d370
parent539abffc3e73b462479e2763739786c55d784a00 (diff)
igt/gem_exec_create: Add a "leak" test
Don't close the objects, but just mark them as unneded. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/gem_exec_create.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/gem_exec_create.c b/tests/gem_exec_create.c
index bd0dfb507a48..d5e11037e687 100644
--- a/tests/gem_exec_create.c
+++ b/tests/gem_exec_create.c
@@ -65,7 +65,9 @@ static bool ignore_engine(int fd, unsigned engine)
return false;
}
-static void all(int fd, int timeout)
+#define LEAK 0x1
+
+static void all(int fd, unsigned flags, int timeout)
{
const uint32_t bbe = MI_BATCH_BUFFER_END;
struct drm_i915_gem_execbuffer2 execbuf;
@@ -112,7 +114,10 @@ static void all(int fd, int timeout)
execbuf.flags &= ~ENGINE_FLAGS;
execbuf.flags |= engines[n];
gem_execbuf(fd, &execbuf);
- gem_close(fd, obj.handle);
+ if (flags & LEAK)
+ gem_madvise(fd, obj.handle, I915_MADV_DONTNEED);
+ else
+ gem_close(fd, obj.handle);
}
}
count += nengine * 1024;
@@ -136,7 +141,10 @@ igt_main
igt_fork_hang_detector(device);
igt_subtest("basic")
- all(device, 20);
+ all(device, 0, 20);
+
+ igt_subtest("madvise")
+ all(device, LEAK, 20);
igt_stop_hang_detector();