Skip to content

anv: Move device memory maps back to anv_device_memory

This effectively partially reverts 13fe4371 ("anv: Add helpers in anv_allocator for mapping BOs") where we both added helpers and reworked memory mapping to stash the maps on the BO. The problem comes with external memory. Due to GEM rules, if a memory object is exported and then imported or imported twice, we have to deduplicate the anv_bo struct but, according to Vulkan rules, they are separate VkDeviceMemory objects. This means we either need to always map whole objects and reference-count the map or we need to handle maps separately for separate VkDeviceMemory objects. For now, take the later path.

Fixes: 13fe4371 ("anv: Add helpers in anv_allocator for mapping BOs") Closes: #5612 (closed)

Edited by Faith Ekstrand

Merge request reports