summaryrefslogtreecommitdiff
path: root/tests/gem_fenced_exec_thrash.c
diff options
context:
space:
mode:
authorDerek Morton <derek.j.morton@intel.com>2015-06-26 11:36:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-06-26 11:49:38 +0100
commitc69b13578399915f71f4ccc10cae188c31381c6a (patch)
tree1139be9e57ca21fbe753fca72fd391e973baab82 /tests/gem_fenced_exec_thrash.c
parenteeda401391de3ab434dcdd1d1b441a24660a0fd3 (diff)
igt/gem_fenced_exec_thrash: Fix memory leak between tests
gem_fenced_exec_thrash was not freeing any resources between subtests. On 1Gb android systems this resulted in the test failing with an OOM error. Added cleanup code to free BOs at the end of each subtest. Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Diffstat (limited to 'tests/gem_fenced_exec_thrash.c')
-rw-r--r--tests/gem_fenced_exec_thrash.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index 75f251cc..c0e820f8 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -215,6 +215,18 @@ static void run_test(int fd, int num_fences, int expected_errno,
if (flags & INTERRUPTIBLE)
igt_stop_signal_helper();
+
+ /* Cleanup */
+ for (n = 0; n < 2*num_fences; n++)
+ gem_close(fd, exec[0][n].handle);
+
+ for (i = 0; i < 2; i++)
+ gem_close(fd, exec[i][2*num_fences].handle);
+
+ if (flags & BUSY_LOAD) {
+ intel_batchbuffer_free(batch);
+ drm_intel_bufmgr_destroy(bufmgr);
+ }
}
int fd;