diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2016-02-25 12:57:05 -0800 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2016-02-25 12:57:05 -0800 |
commit | 65959123cef8cb80b67ecfa5294b7d9b721a64e0 (patch) | |
tree | 14903ab6ca27a2017cdb0f62f12561d298d770a6 | |
parent | fde3eafa3dbb4dc3ca4a6c16219f7f9921563e4e (diff) |
tests/gem_svm_fault: test CPU and GTT maps toosvm
Another important use case.
-rw-r--r-- | tests/gem_svm_fault.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/gem_svm_fault.c b/tests/gem_svm_fault.c index b98f3331..baaf0007 100644 --- a/tests/gem_svm_fault.c +++ b/tests/gem_svm_fault.c @@ -55,6 +55,7 @@ static int devid; static int fd; static drm_intel_bufmgr *bufmgr; drm_intel_context *ctx; +static drm_intel_bo *target_bo; static uint32_t *target_buffer; static uint32_t *expected_fault_addr; static uint32_t batch_buffer[8]; @@ -182,6 +183,38 @@ igt_main free(target_buffer); } + igt_subtest_f("basic-bo-cpu-map-%s", rings[i].name) { + int size = 4096; + int offset = size/4; + int count = 4; + + target_bo = drm_intel_bo_alloc(bufmgr, + "target svm buffer", + size, size); + drm_intel_bo_map(target_bo, true); + target_buffer = target_bo->virtual; + igt_assert_f(target_buffer, "failed to alloc target buffer\n"); + store_test(rings[i].id, count, offset); + drm_intel_bo_unmap(target_bo); + drm_intel_bo_unreference(target_bo); + } + + igt_subtest_f("basic-bo-gtt-map-%s", rings[i].name) { + int size = 4096; + int offset = size/4; + int count = 4; + + target_bo = drm_intel_bo_alloc(bufmgr, + "target svm buffer", + size, size); + drm_intel_gem_bo_map_gtt(target_bo); + target_buffer = target_bo->virtual; + igt_assert_f(target_buffer, "failed to alloc target buffer\n"); + store_test(rings[i].id, count, offset); + drm_intel_gem_bo_unmap_gtt(target_bo); + drm_intel_bo_unreference(target_bo); + } + igt_subtest_f("basic-bad-fault-%s", rings[i].name) { struct sigaction act; struct sigaction old_handler; |