radv: try and fix internal transfer queue mapping

The WSI code wants to remain generic and try and use vulkan APIs,
even though these queues aren't exposed through the API.

Add the transfer queue to the end of the queues.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15357>
This commit is contained in:
Dave Airlie
2022-03-13 05:42:10 +10:00
committed by Marge Bot
parent 57ddfcaa2d
commit 177805cc03
3 changed files with 11 additions and 3 deletions

View File

@@ -568,15 +568,19 @@ radv_is_conformant(const struct radv_physical_device *pdevice)
static void
radv_physical_device_init_queue_table(struct radv_physical_device *pdevice)
{
pdevice->vk_queue_to_radv[0] = RADV_QUEUE_GENERAL;
int idx = 0;
pdevice->vk_queue_to_radv[idx] = RADV_QUEUE_GENERAL;
idx++;
for (unsigned i = 1; i < RADV_MAX_QUEUE_FAMILIES; i++)
pdevice->vk_queue_to_radv[i] = RADV_MAX_QUEUE_FAMILIES + 1;
if (pdevice->rad_info.num_rings[RING_COMPUTE] > 0 &&
!(pdevice->instance->debug_flags & RADV_DEBUG_NO_COMPUTE_QUEUE)) {
pdevice->vk_queue_to_radv[1] = RADV_QUEUE_COMPUTE;
pdevice->vk_queue_to_radv[idx] = RADV_QUEUE_COMPUTE;
idx++;
}
pdevice->num_queues = idx;
}
static VkResult

View File

@@ -326,6 +326,7 @@ struct radv_physical_device {
nir_shader_compiler_options nir_options[MESA_VULKAN_SHADER_STAGES];
enum radv_queue_family vk_queue_to_radv[RADV_MAX_QUEUE_FAMILIES];
uint32_t num_queues;
};
struct radv_instance {

View File

@@ -60,11 +60,14 @@ radv_wsi_get_prime_blit_queue(VkDevice _device)
if (device->physical_device->rad_info.chip_class >= GFX9 &&
!(device->physical_device->instance->debug_flags & RADV_DEBUG_NO_DMA_BLIT)) {
device->physical_device->vk_queue_to_radv[device->physical_device->num_queues++] = RADV_QUEUE_TRANSFER;
const VkDeviceQueueCreateInfo queue_create = {
.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
.queueFamilyIndex = RADV_QUEUE_TRANSFER,
.queueFamilyIndex = device->physical_device->num_queues - 1,
.queueCount = 1,
};
device->private_sdma_queue = vk_zalloc(&device->vk.alloc, sizeof(struct radv_queue), 8,
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);