summaryrefslogtreecommitdiff
path: root/tests/vgem_basic.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-05 14:40:16 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-05 14:42:28 +0100
commit8abe91985b30f8a26cdcb6816d2393956f171ea5 (patch)
treece060bfbfcf7af256c2ac2ab71130e9ea47b8db1 /tests/vgem_basic.c
parentd2adbdf8fc6f77ef27ee5f5bb8b0191ed27e05b2 (diff)
igt/vgem_basic: Allow mmap() to persist without the vgem module loaded
Since vgem doesn't have any callbacks from shmemfs to its, we don't need to keep the module around to service a pagefault when only using the shmemfs facilities. Adjust the test to try to unload and check the mmap for access. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/vgem_basic.c')
-rw-r--r--tests/vgem_basic.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/vgem_basic.c b/tests/vgem_basic.c
index 263ea5f0..5b54a4a3 100644
--- a/tests/vgem_basic.c
+++ b/tests/vgem_basic.c
@@ -349,16 +349,14 @@ static void test_unload(void)
close(dmabuf);
/* Although closed, the mmap should keep the dmabuf/module alive */
- igt_assert_f(module_unload() != 0,
- "A mmap should keep the module alive\n");
+ igt_assert_f(module_unload() == 0,
+ "A mmap should not keep the module alive\n");
for (int page = 0; page < bo.size >> 12; page++)
ptr[1024*page + page%1024] = page;
/* And finally we should have no more uses on the module. */
munmap(ptr, bo.size);
- igt_assert_f(module_unload() == 0,
- "No open mmap, should be able to unload\n");
}
static bool has_prime_export(int fd)