From b24c18667d303ef6872033f239454562e566bc6a Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 17 Mar 2026 12:31:33 +0100 Subject: [PATCH] radv: remove radv_device::use_global_bo_list This is always TRUE now. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 12 ----- src/amd/vulkan/radv_descriptors.h | 71 ----------------------------- src/amd/vulkan/radv_device.c | 5 +- src/amd/vulkan/radv_device.h | 3 -- src/amd/vulkan/radv_device_memory.c | 16 ++----- src/amd/vulkan/radv_wsi.c | 4 +- 6 files changed, 8 insertions(+), 103 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index e99e344cf18..ad316933949 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -8025,12 +8025,6 @@ radv_bind_descriptor_set(struct radv_cmd_buffer *cmd_buffer, VkPipelineBindPoint assert(set); assert(!(set->header.layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT)); - if (!device->use_global_bo_list) { - for (unsigned j = 0; j < set->header.buffer_count; ++j) - if (set->descriptors[j]) - radv_cs_add_buffer(ws, cs->b, set->descriptors[j]); - } - if (set->header.bo) radv_cs_add_buffer(ws, cs->b, set->header.bo); } @@ -14305,9 +14299,6 @@ radv_CmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress) { VK_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); - struct radv_device *device = radv_cmd_buffer_device(cmd_buffer); - - assert(device->use_global_bo_list); VkTraceRaysIndirectCommand2KHR tables = { .raygenShaderRecordAddress = pRaygenShaderBindingTable->deviceAddress, @@ -14330,9 +14321,6 @@ VKAPI_ATTR void VKAPI_CALL radv_CmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress) { VK_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); - struct radv_device *device = radv_cmd_buffer_device(cmd_buffer); - - assert(device->use_global_bo_list); radv_trace_rays(cmd_buffer, NULL, indirectDeviceAddress, radv_rt_mode_indirect2); } diff --git a/src/amd/vulkan/radv_descriptors.h b/src/amd/vulkan/radv_descriptors.h index 8786935b8d2..2d2d5e5f8a2 100644 --- a/src/amd/vulkan/radv_descriptors.h +++ b/src/amd/vulkan/radv_descriptors.h @@ -38,16 +38,6 @@ radv_write_texel_buffer_descriptor(struct radv_device *device, struct radv_cmd_b } memcpy(dst, buffer_view->state, RADV_BUFFER_DESC_SIZE); - - if (device->use_global_bo_list) - return; - - if (cmd_buffer) { - struct radv_cmd_stream *cs = cmd_buffer->cs; - radv_cs_add_buffer(device->ws, cs->b, buffer_view->bo); - } else { - *buffer_list = buffer_view->bo; - } } static ALWAYS_INLINE void @@ -82,22 +72,6 @@ radv_write_buffer_descriptor_impl(struct radv_device *device, struct radv_cmd_bu } radv_write_buffer_descriptor(device, dst, va, range); - - if (device->use_global_bo_list) - return; - - if (!buffer) { - if (!cmd_buffer) - *buffer_list = NULL; - return; - } - - if (cmd_buffer) { - struct radv_cmd_stream *cs = cmd_buffer->cs; - radv_cs_add_buffer(device->ws, cs->b, buffer->bo); - } else { - *buffer_list = buffer->bo; - } } static ALWAYS_INLINE void @@ -178,30 +152,7 @@ radv_write_image_descriptor_impl(struct radv_device *device, struct radv_cmd_buf unsigned *dst, struct radeon_winsys_bo **buffer_list, VkDescriptorType descriptor_type, const VkDescriptorImageInfo *image_info) { - VK_FROM_HANDLE(radv_image_view, iview, image_info->imageView); - radv_write_image_descriptor(dst, size, descriptor_type, image_info); - - if (device->use_global_bo_list) - return; - - if (!iview) { - if (!cmd_buffer) - *buffer_list = NULL; - return; - } - - const uint32_t max_bindings = sizeof(iview->image->bindings) / sizeof(iview->image->bindings[0]); - for (uint32_t b = 0; b < max_bindings; b++) { - if (cmd_buffer) { - struct radv_cmd_stream *cs = cmd_buffer->cs; - if (iview->image->bindings[b].bo) - radv_cs_add_buffer(device->ws, cs->b, iview->image->bindings[b].bo); - } else { - *buffer_list = iview->image->bindings[b].bo; - buffer_list++; - } - } } static ALWAYS_INLINE void @@ -232,29 +183,7 @@ static ALWAYS_INLINE void radv_write_image_descriptor_ycbcr_impl(struct radv_device *device, struct radv_cmd_buffer *cmd_buffer, unsigned *dst, struct radeon_winsys_bo **buffer_list, const VkDescriptorImageInfo *image_info) { - VK_FROM_HANDLE(radv_image_view, iview, image_info->imageView); - radv_write_image_descriptor_ycbcr(device, dst, image_info); - - if (device->use_global_bo_list) - return; - - if (!iview) { - if (!cmd_buffer) - *buffer_list = NULL; - return; - } - - for (uint32_t b = 0; b < ARRAY_SIZE(iview->image->bindings); b++) { - if (cmd_buffer) { - struct radv_cmd_stream *cs = cmd_buffer->cs; - if (iview->image->bindings[b].bo) - radv_cs_add_buffer(device->ws, cs->b, iview->image->bindings[b].bo); - } else { - *buffer_list = iview->image->bindings[b].bo; - buffer_list++; - } - } } static ALWAYS_INLINE void diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 063b9d64c23..9b3d802929a 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1264,9 +1264,8 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr ? NULL : pdev->ws->copy_sync_payloads; - /* Enable the global BO list by default. */ - /* TODO: Remove the per cmdbuf BO list tracking after few Mesa releases if no blockers. */ - device->use_global_bo_list = pdev->info.has_vm_always_valid; + /* VM_ALWAYS_VALID must be supported. */ + assert(pdev->info.has_vm_always_valid); device->overallocation_disallowed = overallocation_disallowed; mtx_init(&device->overallocation_mutex, mtx_plain); diff --git a/src/amd/vulkan/radv_device.h b/src/amd/vulkan/radv_device.h index ad2901d009c..e78d0130b7f 100644 --- a/src/amd/vulkan/radv_device.h +++ b/src/amd/vulkan/radv_device.h @@ -203,9 +203,6 @@ struct radv_device { /* Whether to inline the compute dispatch size in user sgprs. */ bool load_grid_size_from_user_sgpr; - /* Whether the driver uses a global BO list. */ - bool use_global_bo_list; - /* Whether anisotropy is forced with RADV_TEX_ANISO (-1 is disabled). */ int force_aniso; diff --git a/src/amd/vulkan/radv_device_memory.c b/src/amd/vulkan/radv_device_memory.c index 8fe73818484..84cff64db67 100644 --- a/src/amd/vulkan/radv_device_memory.c +++ b/src/amd/vulkan/radv_device_memory.c @@ -61,8 +61,7 @@ radv_free_memory(struct radv_device *device, const VkAllocationCallbacks *pAlloc mtx_unlock(&device->overallocation_mutex); } - if (device->use_global_bo_list) - device->ws->buffer_make_resident(device->ws, mem->bo, false); + device->ws->buffer_make_resident(device->ws, mem->bo, false); radv_bo_destroy(device, &mem->base, mem->bo); mem->bo = NULL; } @@ -227,10 +226,7 @@ radv_alloc_memory(struct radv_device *device, const VkMemoryAllocateInfo *pAlloc flags |= RADEON_FLAG_GTT_WC; } else if (!import_info) { /* neither export nor import */ - flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING; - if (device->use_global_bo_list) { - flags |= RADEON_FLAG_PREFER_LOCAL_BO; - } + flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING | RADEON_FLAG_PREFER_LOCAL_BO; } if (flags_info && flags_info->flags & VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT) @@ -309,11 +305,9 @@ radv_alloc_memory(struct radv_device *device, const VkMemoryAllocateInfo *pAlloc } if (!wsi_info) { - if (device->use_global_bo_list) { - result = device->ws->buffer_make_resident(device->ws, mem->bo, true); - if (result != VK_SUCCESS) - goto fail; - } + result = device->ws->buffer_make_resident(device->ws, mem->bo, true); + if (result != VK_SUCCESS) + goto fail; } *pMem = radv_device_memory_to_handle(mem); diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c index 835b17e50aa..4bce487f659 100644 --- a/src/amd/vulkan/radv_wsi.c +++ b/src/amd/vulkan/radv_wsi.c @@ -29,9 +29,7 @@ radv_wsi_set_memory_ownership(VkDevice _device, VkDeviceMemory _mem, VkBool32 ow VK_FROM_HANDLE(radv_device, device, _device); VK_FROM_HANDLE(radv_device_memory, mem, _mem); - if (device->use_global_bo_list) { - device->ws->buffer_make_resident(device->ws, mem->bo, ownership); - } + device->ws->buffer_make_resident(device->ws, mem->bo, ownership); } static struct vk_queue *