mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-22 23:36:30 +00:00
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>
This commit is contained in:
parent
539abffc3e
commit
3076951698
@ -65,7 +65,9 @@ static bool ignore_engine(int fd, unsigned engine)
|
|||||||
return false;
|
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;
|
const uint32_t bbe = MI_BATCH_BUFFER_END;
|
||||||
struct drm_i915_gem_execbuffer2 execbuf;
|
struct drm_i915_gem_execbuffer2 execbuf;
|
||||||
@ -112,6 +114,9 @@ static void all(int fd, int timeout)
|
|||||||
execbuf.flags &= ~ENGINE_FLAGS;
|
execbuf.flags &= ~ENGINE_FLAGS;
|
||||||
execbuf.flags |= engines[n];
|
execbuf.flags |= engines[n];
|
||||||
gem_execbuf(fd, &execbuf);
|
gem_execbuf(fd, &execbuf);
|
||||||
|
if (flags & LEAK)
|
||||||
|
gem_madvise(fd, obj.handle, I915_MADV_DONTNEED);
|
||||||
|
else
|
||||||
gem_close(fd, obj.handle);
|
gem_close(fd, obj.handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,7 +141,10 @@ igt_main
|
|||||||
igt_fork_hang_detector(device);
|
igt_fork_hang_detector(device);
|
||||||
|
|
||||||
igt_subtest("basic")
|
igt_subtest("basic")
|
||||||
all(device, 20);
|
all(device, 0, 20);
|
||||||
|
|
||||||
|
igt_subtest("madvise")
|
||||||
|
all(device, LEAK, 20);
|
||||||
|
|
||||||
igt_stop_hang_detector();
|
igt_stop_hang_detector();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user