diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-22 22:14:33 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-23 08:18:23 +0000 |
commit | 69ecedea735425cfb9a5d7dfcaa5840393553fd1 (patch) | |
tree | 9054d65d3be2e2b4f41f5ae524d79e0465d32f50 | |
parent | 3eae640b817fc506aafafb417e432b521517ed1a (diff) |
igt/gem_concurrent_blit: Allocate a private batch cache for the child
We have to avoid the COW alias for the intel_bufmgr and intel_batch
cache as the child may close the object (in its local cache) leaving an
alias in the parent cache pointing to a stale object.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_concurrent_all.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index 130a4de0..1ce2a562 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -1135,9 +1135,21 @@ static void run_child(struct buffers *buffers, do_hang do_hang_func) { - igt_fork(child, 1) + /* We inherit the buffers from the parent, but the bufmgr/batch + * needs to be local as the cache of reusable itself will be COWed, + * leading to the child closing an object without the parent knowing. + */ + igt_fork(child, 1) { + buffers->bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); + drm_intel_bufmgr_gem_enable_reuse(buffers->bufmgr); + batch = intel_batchbuffer_alloc(buffers->bufmgr, devid); + do_test_func(buffers, do_copy_func, do_hang_func); + intel_batchbuffer_free(batch); + drm_intel_bufmgr_destroy(buffers->bufmgr); + } + igt_waitchildren(); igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } |