diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-01-13 09:17:29 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-01-13 09:18:52 +0000 |
commit | 3214a27b5ba7cd621b091f1d0702e069a750c054 (patch) | |
tree | a9fe1d2db32a52623e694d04798cbc7eaee726b8 | |
parent | 5fb26d1469f95ea93df2f047f57c0cdcf27da5d7 (diff) |
igt/gem_mmap_wc: Reorder gem_close()
Unlike a GTT mmap, a WC mmap does not have a direct reference to the
object, only to the backing storage. If we want to control the domain
correctly for mmap(wc), we have to keep the bo reference around.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88356
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_mmap_wc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/gem_mmap_wc.c b/tests/gem_mmap_wc.c index 4881ab73..2edb332a 100644 --- a/tests/gem_mmap_wc.c +++ b/tests/gem_mmap_wc.c @@ -281,11 +281,10 @@ test_write_cpu_read_wc(int fd) src = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE); igt_assert(src != (uint32_t *)MAP_FAILED); - gem_close(fd, handle); - memset(src, 0xaa, OBJECT_SIZE); set_domain(fd, handle); igt_assert(memcmp(dst, src, OBJECT_SIZE) == 0); + gem_close(fd, handle); munmap(src, OBJECT_SIZE); munmap(dst, OBJECT_SIZE); @@ -308,10 +307,9 @@ test_write_gtt_read_wc(int fd) src = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_WRITE); igt_assert(src != (uint32_t *)MAP_FAILED); - gem_close(fd, handle); - memset(src, 0xaa, OBJECT_SIZE); igt_assert(memcmp(dst, src, OBJECT_SIZE) == 0); + gem_close(fd, handle); munmap(src, OBJECT_SIZE); munmap(dst, OBJECT_SIZE); |