radv: hide the sparse queue when radv_legacy_sparse_binding

This change is unnecessary but should be harmless.  We will have other
reasons to hide the sparse queue so do it here for
radv_legacy_sparse_binding as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27838>
This commit is contained in:
Chia-I Wu
2024-02-27 13:34:25 -08:00
committed by Marge Bot
parent 0ac7ea7578
commit dd84a575c0
4 changed files with 29 additions and 14 deletions
+1 -1
View File
@@ -341,7 +341,7 @@ radv_describe_begin_cmd_buffer(struct radv_cmd_buffer *cmd_buffer)
if (cmd_buffer->qf == RADV_QUEUE_GENERAL)
marker.queue_flags |= VK_QUEUE_GRAPHICS_BIT;
if (cmd_buffer->device->instance->drirc.legacy_sparse_binding)
if (!radv_sparse_queue_enabled(cmd_buffer->device->physical_device))
marker.queue_flags |= VK_QUEUE_SPARSE_BINDING_BIT;
radv_emit_sqtt_userdata(cmd_buffer, &marker, sizeof(marker) / 4);
+21 -12
View File
@@ -246,7 +246,10 @@ radv_physical_device_init_queue_table(struct radv_physical_device *pdevice)
idx++;
}
pdevice->vk_queue_to_radv[idx++] = RADV_QUEUE_SPARSE;
if (radv_sparse_queue_enabled(pdevice)) {
pdevice->vk_queue_to_radv[idx] = RADV_QUEUE_SPARSE;
idx++;
}
pdevice->num_queues = idx;
}
@@ -2193,7 +2196,7 @@ static void
radv_get_physical_device_queue_family_properties(struct radv_physical_device *pdevice, uint32_t *pCount,
VkQueueFamilyProperties **pQueueFamilyProperties)
{
int num_queue_families = 2;
int num_queue_families = 1;
int idx;
if (pdevice->rad_info.ip[AMD_IP_COMPUTE].num_queues > 0 &&
!(pdevice->instance->debug_flags & RADV_DEBUG_NO_COMPUTE_QUEUE))
@@ -2208,6 +2211,10 @@ radv_get_physical_device_queue_family_properties(struct radv_physical_device *pd
num_queue_families++;
}
if (radv_sparse_queue_enabled(pdevice)) {
num_queue_families++;
}
if (pQueueFamilyProperties == NULL) {
*pCount = num_queue_families;
return;
@@ -2219,7 +2226,7 @@ radv_get_physical_device_queue_family_properties(struct radv_physical_device *pd
idx = 0;
if (*pCount >= 1) {
VkQueueFlags gfx_flags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT;
if (pdevice->instance->drirc.legacy_sparse_binding)
if (!radv_sparse_queue_enabled(pdevice))
gfx_flags |= VK_QUEUE_SPARSE_BINDING_BIT;
*pQueueFamilyProperties[idx] = (VkQueueFamilyProperties){
.queueFlags = gfx_flags,
@@ -2233,7 +2240,7 @@ radv_get_physical_device_queue_family_properties(struct radv_physical_device *pd
if (pdevice->rad_info.ip[AMD_IP_COMPUTE].num_queues > 0 &&
!(pdevice->instance->debug_flags & RADV_DEBUG_NO_COMPUTE_QUEUE)) {
VkQueueFlags compute_flags = VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT;
if (pdevice->instance->drirc.legacy_sparse_binding)
if (!radv_sparse_queue_enabled(pdevice))
compute_flags |= VK_QUEUE_SPARSE_BINDING_BIT;
if (*pCount > idx) {
*pQueueFamilyProperties[idx] = (VkQueueFamilyProperties){
@@ -2272,14 +2279,16 @@ radv_get_physical_device_queue_family_properties(struct radv_physical_device *pd
}
}
if (*pCount > idx) {
*pQueueFamilyProperties[idx] = (VkQueueFamilyProperties){
.queueFlags = VK_QUEUE_SPARSE_BINDING_BIT,
.queueCount = 1,
.timestampValidBits = 64,
.minImageTransferGranularity = (VkExtent3D){1, 1, 1},
};
idx++;
if (radv_sparse_queue_enabled(pdevice)) {
if (*pCount > idx) {
*pQueueFamilyProperties[idx] = (VkQueueFamilyProperties){
.queueFlags = VK_QUEUE_SPARSE_BINDING_BIT,
.queueCount = 1,
.timestampValidBits = 64,
.minImageTransferGranularity = (VkExtent3D){1, 1, 1},
};
idx++;
}
}
*pCount = idx;
+6
View File
@@ -742,6 +742,12 @@ struct radv_meta_state {
#define RADV_NUM_HW_CTX (RADEON_CTX_PRIORITY_REALTIME + 1)
static inline bool
radv_sparse_queue_enabled(const struct radv_physical_device *pdevice)
{
return !pdevice->instance->drirc.legacy_sparse_binding;
}
static inline enum radv_queue_family
vk_queue_to_radv(const struct radv_physical_device *phys_dev, int queue_family_index)
{
+1 -1
View File
@@ -1751,7 +1751,7 @@ radv_queue_submit(struct vk_queue *vqueue, struct vk_queue_submit *submission)
struct radv_queue *queue = (struct radv_queue *)vqueue;
VkResult result;
if (queue->device->instance->drirc.legacy_sparse_binding) {
if (!radv_sparse_queue_enabled(queue->device->physical_device)) {
result = radv_queue_submit_bind_sparse_memory(queue->device, submission);
if (result != VK_SUCCESS)
goto fail;