anv: use anv_gem_munmap in block pool cleanup
authorTapani Pälli <tapani.palli@intel.com>
Wed, 6 Mar 2019 08:49:21 +0000 (10:49 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 7 Mar 2019 05:36:28 +0000 (07:36 +0200)
commita9555f37d5b15c86aed73d0dab8d514751e12a54
tree904e669b264976d50d07247e154c2f361adad83a
parent744b8e1c12f2f3857070a895bf6a4351f071a3f9
anv: use anv_gem_munmap in block pool cleanup

Use anv_gem_munmap for unmap when softpin in use, this corresponds to
anv_gem_mmap used in anv_block_pool_expand_range. This fixes valgrind
errors seen for each pool when softpin is in use:

  ==25581== 262,144 bytes in 1 blocks are definitely lost in loss record 31 of 31
  ==25581==    at 0x50E77E8: anv_gem_mmap (anv_gem.c:96)
  ==25581==    by 0x50EEE2B: anv_block_pool_expand_range (anv_allocator.c:543)
  ==25581==    by 0x50EEB51: anv_block_pool_init (anv_allocator.c:477)
  ==25581==    by 0x50EF7EF: anv_state_pool_init (anv_allocator.c:920)
  ==25581==    by 0x510B8EB: anv_CreateDevice (anv_device.c:2031)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_allocator.c