anv: Rename ANV_BO_ALLOC_SNOOPED to ANV_BO_ALLOC_HOST_CACHED_COHERENT

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
This commit is contained in:
José Roberto de Souza 2023-11-10 08:45:48 -08:00 committed by Marge Bot
parent d50d9eccad
commit 3baab9bb38
8 changed files with 34 additions and 34 deletions

View file

@ -377,7 +377,7 @@ anv_block_pool_init(struct anv_block_pool *pool,
pool->bo_alloc_flags =
ANV_BO_ALLOC_FIXED_ADDRESS |
ANV_BO_ALLOC_MAPPED |
ANV_BO_ALLOC_SNOOPED |
ANV_BO_ALLOC_HOST_CACHED_COHERENT |
ANV_BO_ALLOC_CAPTURE;
result = anv_block_pool_expand_range(pool, initial_size);
@ -1439,11 +1439,11 @@ anv_bo_get_mmap_mode(struct anv_device *device, struct anv_bo *bo)
/* gfx9 atom */
if (!device->info->has_llc) {
/* ANV_BO_ALLOC_SNOOPED means that user wants a cached and coherent memory
* but to achieve it without LLC in older platforms
* DRM_IOCTL_I915_GEM_SET_CACHING needs to be supported and set.
/* user wants a cached and coherent memory but to achieve it without
* LLC in older platforms DRM_IOCTL_I915_GEM_SET_CACHING needs to be
* supported and set.
*/
if (alloc_flags & ANV_BO_ALLOC_SNOOPED)
if (alloc_flags & ANV_BO_ALLOC_HOST_CACHED_COHERENT)
return INTEL_DEVICE_INFO_MMAP_MODE_WB;
return INTEL_DEVICE_INFO_MMAP_MODE_WC;
@ -1590,7 +1590,7 @@ anv_device_import_bo_from_host_ptr(struct anv_device *device,
struct anv_bo **bo_out)
{
assert(!(alloc_flags & (ANV_BO_ALLOC_MAPPED |
ANV_BO_ALLOC_SNOOPED |
ANV_BO_ALLOC_HOST_CACHED_COHERENT |
ANV_BO_ALLOC_DEDICATED |
ANV_BO_ALLOC_PROTECTED |
ANV_BO_ALLOC_FIXED_ADDRESS)));
@ -1648,7 +1648,7 @@ anv_device_import_bo_from_host_ptr(struct anv_device *device,
__sync_fetch_and_add(&bo->refcount, 1);
} else {
/* Makes sure that userptr gets WB mmap caching and right VM PAT index */
alloc_flags |= (ANV_BO_ALLOC_SNOOPED | ANV_BO_ALLOC_NO_LOCAL_MEM);
alloc_flags |= (ANV_BO_ALLOC_HOST_CACHED_COHERENT | ANV_BO_ALLOC_NO_LOCAL_MEM);
struct anv_bo new_bo = {
.name = "host-ptr",
.gem_handle = gem_handle,
@ -1694,7 +1694,7 @@ anv_device_import_bo(struct anv_device *device,
struct anv_bo **bo_out)
{
assert(!(alloc_flags & (ANV_BO_ALLOC_MAPPED |
ANV_BO_ALLOC_SNOOPED |
ANV_BO_ALLOC_HOST_CACHED_COHERENT |
ANV_BO_ALLOC_FIXED_ADDRESS)));
assert(alloc_flags & ANV_BO_ALLOC_EXTERNAL);
@ -1738,7 +1738,7 @@ anv_device_import_bo(struct anv_device *device,
__sync_fetch_and_add(&bo->refcount, 1);
} else {
/* so imported bos get WB and correct PAT index */
alloc_flags |= (ANV_BO_ALLOC_SNOOPED | ANV_BO_ALLOC_NO_LOCAL_MEM);
alloc_flags |= (ANV_BO_ALLOC_HOST_CACHED_COHERENT | ANV_BO_ALLOC_NO_LOCAL_MEM);
struct anv_bo new_bo = {
.name = "imported",
.gem_handle = gem_handle,

View file

@ -1121,7 +1121,7 @@ VkResult anv_CreateDescriptorPool(
descriptor_bo_size,
ANV_BO_ALLOC_CAPTURE |
ANV_BO_ALLOC_MAPPED |
ANV_BO_ALLOC_SNOOPED |
ANV_BO_ALLOC_HOST_CACHED_COHERENT |
ANV_BO_ALLOC_DESCRIPTOR_POOL,
0 /* explicit_address */,
&pool->bo);

View file

@ -3355,7 +3355,7 @@ VkResult anv_CreateDevice(
anv_bo_pool_init(&device->batch_bo_pool, device, "batch",
ANV_BO_ALLOC_MAPPED |
ANV_BO_ALLOC_SNOOPED |
ANV_BO_ALLOC_HOST_CACHED_COHERENT |
ANV_BO_ALLOC_CAPTURE);
if (device->vk.enabled_extensions.KHR_acceleration_structure) {
anv_bo_pool_init(&device->bvh_bo_pool, device, "bvh build",
@ -4149,7 +4149,7 @@ VkResult anv_AllocateMemory(
if ((mem_type->propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) &&
(mem_type->propertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) &&
(alloc_flags & (ANV_BO_ALLOC_EXTERNAL | ANV_BO_ALLOC_SCANOUT)) == 0)
alloc_flags |= ANV_BO_ALLOC_SNOOPED;
alloc_flags |= ANV_BO_ALLOC_HOST_CACHED_COHERENT;
if (mem->vk.ahardware_buffer) {
result = anv_import_ahw_memory(_device, mem);
@ -5184,7 +5184,7 @@ const struct intel_device_info_pat_entry *
anv_device_get_pat_entry(struct anv_device *device,
enum anv_bo_alloc_flags alloc_flags)
{
if (alloc_flags & (ANV_BO_ALLOC_SNOOPED))
if (alloc_flags & (ANV_BO_ALLOC_HOST_CACHED_COHERENT))
return &device->info->pat.cached_coherent;
else if (alloc_flags & (ANV_BO_ALLOC_EXTERNAL | ANV_BO_ALLOC_SCANOUT))
return &device->info->pat.scanout;

View file

@ -94,7 +94,7 @@ anv_measure_init(struct anv_cmd_buffer *cmd_buffer)
ASSERTED VkResult result =
anv_device_alloc_bo(device, "measure data",
config->batch_size * sizeof(uint64_t),
ANV_BO_ALLOC_MAPPED | ANV_BO_ALLOC_SNOOPED,
ANV_BO_ALLOC_MAPPED | ANV_BO_ALLOC_HOST_CACHED_COHERENT,
0,
(struct anv_bo**)&measure->bo);
measure->base.timestamps = measure->bo->map;

View file

@ -367,64 +367,64 @@ enum anv_bo_alloc_flags {
*
* This is the opposite of EXEC_OBJECT_SUPPORTS_48B_ADDRESS.
*/
ANV_BO_ALLOC_32BIT_ADDRESS = (1 << 0),
ANV_BO_ALLOC_32BIT_ADDRESS = (1 << 0),
/** Specifies that the BO may be shared externally */
ANV_BO_ALLOC_EXTERNAL = (1 << 1),
ANV_BO_ALLOC_EXTERNAL = (1 << 1),
/** Specifies that the BO should be mapped */
ANV_BO_ALLOC_MAPPED = (1 << 2),
ANV_BO_ALLOC_MAPPED = (1 << 2),
/** Specifies that the BO should be snooped so we get coherency */
ANV_BO_ALLOC_SNOOPED = (1 << 3),
/** Specifies that the BO should be cached and coherent */
ANV_BO_ALLOC_HOST_CACHED_COHERENT = (1 << 3),
/** Specifies that the BO should be captured in error states */
ANV_BO_ALLOC_CAPTURE = (1 << 4),
ANV_BO_ALLOC_CAPTURE = (1 << 4),
/** Specifies that the BO will have an address assigned by the caller
*
* Such BOs do not exist in any VMA heap.
*/
ANV_BO_ALLOC_FIXED_ADDRESS = (1 << 5),
ANV_BO_ALLOC_FIXED_ADDRESS = (1 << 5),
/** Enables implicit synchronization on the BO
*
* This is the opposite of EXEC_OBJECT_ASYNC.
*/
ANV_BO_ALLOC_IMPLICIT_SYNC = (1 << 6),
ANV_BO_ALLOC_IMPLICIT_SYNC = (1 << 6),
/** Enables implicit synchronization on the BO
*
* This is equivalent to EXEC_OBJECT_WRITE.
*/
ANV_BO_ALLOC_IMPLICIT_WRITE = (1 << 7),
ANV_BO_ALLOC_IMPLICIT_WRITE = (1 << 7),
/** Has an address which is visible to the client */
ANV_BO_ALLOC_CLIENT_VISIBLE_ADDRESS = (1 << 8),
ANV_BO_ALLOC_CLIENT_VISIBLE_ADDRESS = (1 << 8),
/** This BO will be dedicated to a buffer or an image */
ANV_BO_ALLOC_DEDICATED = (1 << 9),
ANV_BO_ALLOC_DEDICATED = (1 << 9),
/** This buffer is allocated from local memory and should be cpu visible */
ANV_BO_ALLOC_LOCAL_MEM_CPU_VISIBLE = (1 << 10),
ANV_BO_ALLOC_LOCAL_MEM_CPU_VISIBLE = (1 << 10),
/** For non device local allocations */
ANV_BO_ALLOC_NO_LOCAL_MEM = (1 << 11),
ANV_BO_ALLOC_NO_LOCAL_MEM = (1 << 11),
/** This buffer will be scanout to display */
ANV_BO_ALLOC_SCANOUT = (1 << 12),
ANV_BO_ALLOC_SCANOUT = (1 << 12),
/** For descriptor pools */
ANV_BO_ALLOC_DESCRIPTOR_POOL = (1 << 13),
ANV_BO_ALLOC_DESCRIPTOR_POOL = (1 << 13),
/** For buffers that will be bound using TR-TT.
*
* Not for buffers used as the TR-TT page tables.
*/
ANV_BO_ALLOC_TRTT = (1 << 14),
ANV_BO_ALLOC_TRTT = (1 << 14),
/** Protected buffer */
ANV_BO_ALLOC_PROTECTED = (1 << 15),
ANV_BO_ALLOC_PROTECTED = (1 << 15),
};
struct anv_bo {

View file

@ -467,7 +467,7 @@ void
anv_device_utrace_init(struct anv_device *device)
{
anv_bo_pool_init(&device->utrace_bo_pool, device, "utrace",
ANV_BO_ALLOC_MAPPED | ANV_BO_ALLOC_SNOOPED);
ANV_BO_ALLOC_MAPPED | ANV_BO_ALLOC_HOST_CACHED_COHERENT);
intel_ds_device_init(&device->ds, device->info, device->fd,
device->physical->local_minor,
INTEL_DS_API_VULKAN);

View file

@ -236,7 +236,7 @@ VkResult genX(CreateQueryPool)(
result = anv_device_alloc_bo(device, "query-pool", size,
ANV_BO_ALLOC_MAPPED |
ANV_BO_ALLOC_SNOOPED,
ANV_BO_ALLOC_HOST_CACHED_COHERENT,
0 /* explicit_address */,
&pool->bo);
if (result != VK_SUCCESS)

View file

@ -111,7 +111,7 @@ i915_gem_create(struct anv_device *device,
*actual_size = gem_create.size;
if (alloc_flags & ANV_BO_ALLOC_SNOOPED) {
if (alloc_flags & ANV_BO_ALLOC_HOST_CACHED_COHERENT) {
/* We don't want to change these defaults if it's going to be shared
* with another process.
*/