summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 2b4182f1..6597acfa 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -58,6 +58,7 @@
#include <glib.h>
#include "drmtest.h"
+#include "intel_allocator.h"
#include "intel_chipset.h"
#include "intel_io.h"
#include "igt_debugfs.h"
@@ -1412,6 +1413,19 @@ __noreturn static void exit_subtest(const char *result)
}
num_test_children = 0;
+ /*
+ * When test completes - mostly in fail state it can leave allocated
+ * objects. An allocator is not an exception as it is global IGT
+ * entity and when test will allocate some ranges and then it will
+ * fail no free/close likely will be called (controling potential
+ * fails and clearing before assertions in IGT is not common).
+ *
+ * We call intel_allocator_init() then to prepare the allocator
+ * infrastructure from scratch for each test. Init also removes
+ * remnants from previous allocator run (if any).
+ */
+ intel_allocator_init();
+
if (!in_dynamic_subtest)
_igt_dynamic_tests_executed = -1;