summaryrefslogtreecommitdiff
path: root/tests/gem_concurrent_blit.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-16 12:07:56 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-16 12:23:17 +0100
commit0d320fdcedf9e5fd512597477e9f4913a3c7af33 (patch)
tree2eb7161e5a567abc39f514c87f0f6645a3752f50 /tests/gem_concurrent_blit.c
parent6332994c269ae5613845a40cd798ffa2f1b86395 (diff)
gem_concurrent_blit: Purge the child bufmgr's cache
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68169
Diffstat (limited to 'tests/gem_concurrent_blit.c')
-rw-r--r--tests/gem_concurrent_blit.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c
index 15e2aac7..69477748 100644
--- a/tests/gem_concurrent_blit.c
+++ b/tests/gem_concurrent_blit.c
@@ -296,6 +296,8 @@ static void run_forked(struct access_mode *mode,
drm_intel_bo_unreference(dst[i]);
}
drm_intel_bo_unreference(dummy);
+ intel_batchbuffer_free(batch);
+ drm_intel_bufmgr_destroy(bufmgr);
exit(0);
}
}
@@ -337,6 +339,10 @@ run_modes(struct access_mode *mode)
drm_intel_bo *src[MAX_NUM_BUFFERS], *dst[MAX_NUM_BUFFERS], *dummy = NULL;
igt_fixture {
+ bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
+ drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+ batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
+
for (int i = 0; i < num_buffers; i++) {
src[i] = mode->create_bo(bufmgr, i, width, height);
dst[i] = mode->create_bo(bufmgr, ~i, width, height);
@@ -353,6 +359,8 @@ run_modes(struct access_mode *mode)
drm_intel_bo_unreference(dst[i]);
}
drm_intel_bo_unreference(dummy);
+ intel_batchbuffer_free(batch);
+ drm_intel_bufmgr_destroy(bufmgr);
}
run_basic_modes(mode, src, dst, dummy, "-forked", run_forked);
@@ -372,10 +380,6 @@ main(int argc, char **argv)
max = gem_aperture_size (fd) / (1024 * 1024) / 2;
if (num_buffers > max)
num_buffers = max;
-
- bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
- drm_intel_bufmgr_gem_enable_reuse(bufmgr);
- batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
}
for (i = 0; i < ARRAY_SIZE(access_modes); i++)