radv: Implement VK_EXT_pci_bus_info.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 13 Oct 2018 17:20:02 +0000 (19:20 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 15 Oct 2018 10:27:49 +0000 (12:27 +0200)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_extensions.py
src/amd/vulkan/radv_private.h

index 88786c999de2b7466d39e9ceeb172d145c8623b6..c418176978ea035786d92fe874163e9a93a6d6c7 100644 (file)
@@ -389,6 +389,7 @@ radv_physical_device_init(struct radv_physical_device *device,
        if ((device->instance->debug_flags & RADV_DEBUG_INFO))
                ac_print_gpu_info(&device->rad_info);
 
+       device->bus_info = *drm_device->businfo.pci;
        return VK_SUCCESS;
 
 fail:
@@ -1190,6 +1191,15 @@ void radv_GetPhysicalDeviceProperties2(
                        properties->conservativeRasterizationPostDepthCoverage = VK_FALSE;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: {
+                       VkPhysicalDevicePCIBusInfoPropertiesEXT *properties =
+                               (VkPhysicalDevicePCIBusInfoPropertiesEXT *)ext;
+                       properties->pciDomain = pdevice->bus_info.domain;
+                       properties->pciBus = pdevice->bus_info.bus;
+                       properties->pciDevice = pdevice->bus_info.dev;
+                       properties->pciFunction = pdevice->bus_info.func;
+                       break;
+               }
                default:
                        break;
                }
index 584926df390d4284960023efbbda696cfe9c3dac..5dcedae1c63b511f34d74defddba01e126c83471 100644 (file)
@@ -103,6 +103,7 @@ EXTENSIONS = [
     Extension('VK_EXT_external_memory_dma_buf',           1, True),
     Extension('VK_EXT_external_memory_host',              1, 'device->rad_info.has_userptr'),
     Extension('VK_EXT_global_priority',                   1, 'device->rad_info.has_ctx_priority'),
+    Extension('VK_EXT_pci_bus_info',                      1, True),
     Extension('VK_EXT_sampler_filter_minmax',             1, 'device->rad_info.chip_class >= CIK'),
     Extension('VK_EXT_shader_viewport_index_layer',       1, True),
     Extension('VK_EXT_shader_stencil_export',             1, True),
index 33ba8a7354b0251f4496d28f1cc917dbc7f06c65..b35aa8d818f2097d09af6fa1a9d2c1c938bcf79c 100644 (file)
@@ -312,6 +312,8 @@ struct radv_physical_device {
        VkPhysicalDeviceMemoryProperties memory_properties;
        enum radv_mem_type mem_type_indices[RADV_MEM_TYPE_COUNT];
 
+       drmPciBusInfo bus_info;
+
        struct radv_device_extension_table supported_extensions;
 };