diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 3222d75ab30..873fbc1c846 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -378,7 +378,8 @@ anv_block_pool_init(struct anv_block_pool *pool, ANV_BO_ALLOC_FIXED_ADDRESS | ANV_BO_ALLOC_MAPPED | ANV_BO_ALLOC_HOST_CACHED_COHERENT | - ANV_BO_ALLOC_CAPTURE; + ANV_BO_ALLOC_CAPTURE | + ANV_BO_ALLOC_INTERNAL; result = anv_block_pool_expand_range(pool, initial_size); if (result != VK_SUCCESS) @@ -1262,7 +1263,8 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool, * so nothing will ever touch the top page. */ const enum anv_bo_alloc_flags alloc_flags = - devinfo->verx10 < 125 ? ANV_BO_ALLOC_32BIT_ADDRESS : 0; + ANV_BO_ALLOC_INTERNAL | + (devinfo->verx10 < 125 ? ANV_BO_ALLOC_32BIT_ADDRESS : 0); VkResult result = anv_device_alloc_bo(device, "scratch", size, alloc_flags, 0 /* explicit_address */, diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 681c4e5cad7..e86c187f35e 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2821,7 +2821,8 @@ anv_device_init_trivial_batch(struct anv_device *device) { VkResult result = anv_device_alloc_bo(device, "trivial-batch", 4096, ANV_BO_ALLOC_MAPPED | - ANV_BO_ALLOC_HOST_COHERENT, + ANV_BO_ALLOC_HOST_COHERENT | + ANV_BO_ALLOC_INTERNAL, 0 /* explicit_address */, &device->trivial_batch_bo); if (result != VK_SUCCESS) @@ -3409,7 +3410,8 @@ VkResult anv_CreateDevice( result = anv_device_alloc_bo(device, "workaround", 8192, ANV_BO_ALLOC_CAPTURE | ANV_BO_ALLOC_HOST_COHERENT | - ANV_BO_ALLOC_MAPPED, + ANV_BO_ALLOC_MAPPED | + ANV_BO_ALLOC_INTERNAL, 0 /* explicit_address */, &device->workaround_bo); if (result != VK_SUCCESS) @@ -3440,7 +3442,7 @@ VkResult anv_CreateDevice( result = anv_device_alloc_bo(device, "ray queries", ray_queries_size, - 0, + ANV_BO_ALLOC_INTERNAL, 0 /* explicit_address */, &device->ray_query_bo); if (result != VK_SUCCESS) @@ -3513,7 +3515,7 @@ VkResult anv_CreateDevice( result = anv_device_alloc_bo(device, "rt-btd-fifo", btd_fifo_bo_size, - 0 /* alloc_flags */, + ANV_BO_ALLOC_INTERNAL, 0 /* explicit_address */, &device->btd_fifo_bo); if (result != VK_SUCCESS) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 2b873c32d9e..51a51cf574d 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -442,6 +442,9 @@ enum anv_bo_alloc_flags { */ ANV_BO_ALLOC_IMPORTED = (1 << 18), + /** Specify whether this BO is internal to the driver */ + ANV_BO_ALLOC_INTERNAL = (1 << 19), + /** Specifies that the BO should be cached and coherent. */ ANV_BO_ALLOC_HOST_CACHED_COHERENT = (ANV_BO_ALLOC_HOST_COHERENT | ANV_BO_ALLOC_HOST_CACHED), };