anv: Track BOs that need a write-combined mapping
v2: simplify logic a bit (Lionel) Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18841>
This commit is contained in:
@@ -1503,6 +1503,7 @@ anv_device_alloc_bo(struct anv_device *device,
|
||||
(alloc_flags & ANV_BO_ALLOC_CLIENT_VISIBLE_ADDRESS) != 0,
|
||||
.has_implicit_ccs = ccs_size > 0 ||
|
||||
(device->info->verx10 >= 125 && !(alloc_flags & ANV_BO_ALLOC_NO_LOCAL_MEM)),
|
||||
.map_wc = alloc_flags & ANV_BO_ALLOC_WRITE_COMBINE,
|
||||
};
|
||||
|
||||
if (alloc_flags & ANV_BO_ALLOC_MAPPED) {
|
||||
@@ -1572,6 +1573,9 @@ anv_device_map_bo(struct anv_device *device,
|
||||
assert(!bo->from_host_ptr);
|
||||
assert(size > 0);
|
||||
|
||||
if (bo->map_wc)
|
||||
gem_flags |= I915_MMAP_WC;
|
||||
|
||||
void *map = anv_gem_mmap(device, bo->gem_handle, offset, size, gem_flags);
|
||||
if (unlikely(map == MAP_FAILED))
|
||||
return vk_errorf(device, VK_ERROR_MEMORY_MAP_FAILED, "mmap failed: %m");
|
||||
|
||||
Reference in New Issue
Block a user