mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-07-25 18:57:41 +00:00
tests/gem_ctx_exec: Add reset-pin-leak subtest
Add a subtest to make sure the kernel doesn't leak the vma pin_count for the last context on reset. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
parent
fedb9b6342
commit
7ef537231a
@ -46,6 +46,7 @@
|
|||||||
#include "ioctl_wrappers.h"
|
#include "ioctl_wrappers.h"
|
||||||
#include "drmtest.h"
|
#include "drmtest.h"
|
||||||
#include "igt_aux.h"
|
#include "igt_aux.h"
|
||||||
|
#include "igt_debugfs.h"
|
||||||
|
|
||||||
struct local_drm_i915_gem_context_destroy {
|
struct local_drm_i915_gem_context_destroy {
|
||||||
__u32 ctx_id;
|
__u32 ctx_id;
|
||||||
@ -92,7 +93,6 @@ static int exec(int fd, uint32_t handle, int ring, int ctx_id)
|
|||||||
|
|
||||||
ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2,
|
ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2,
|
||||||
&execbuf);
|
&execbuf);
|
||||||
gem_sync(fd, handle);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -188,15 +188,43 @@ igt_main
|
|||||||
igt_subtest("basic") {
|
igt_subtest("basic") {
|
||||||
ctx_id = gem_context_create(fd);
|
ctx_id = gem_context_create(fd);
|
||||||
igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0);
|
igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0);
|
||||||
|
gem_sync(fd, handle);
|
||||||
context_destroy(fd, ctx_id);
|
context_destroy(fd, ctx_id);
|
||||||
|
|
||||||
ctx_id = gem_context_create(fd);
|
ctx_id = gem_context_create(fd);
|
||||||
igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0);
|
igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0);
|
||||||
|
gem_sync(fd, handle);
|
||||||
context_destroy(fd, ctx_id);
|
context_destroy(fd, ctx_id);
|
||||||
|
|
||||||
igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) < 0);
|
igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) < 0);
|
||||||
|
gem_sync(fd, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
igt_subtest("eviction")
|
igt_subtest("eviction")
|
||||||
big_exec(fd, handle, I915_EXEC_RENDER);
|
big_exec(fd, handle, I915_EXEC_RENDER);
|
||||||
|
|
||||||
|
igt_subtest("reset-pin-leak") {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use an explicit context to isolate the test from
|
||||||
|
* any major code changes related to the per-file
|
||||||
|
* default context (eg. if they would be eliminated).
|
||||||
|
*/
|
||||||
|
ctx_id = gem_context_create(fd);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Iterate enough times that the kernel will
|
||||||
|
* become unhappy if the ggtt pin count for
|
||||||
|
* the last context is leaked at every reset.
|
||||||
|
*/
|
||||||
|
for (i = 0; i < 20; i++) {
|
||||||
|
igt_set_stop_rings(STOP_RING_DEFAULTS);
|
||||||
|
igt_assert(exec(fd, handle, I915_EXEC_RENDER, 0) == 0);
|
||||||
|
igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0);
|
||||||
|
gem_sync(fd, handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
context_destroy(fd, ctx_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user