From ffaab5593c01858edc3d27d03e73ea635bfcb4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Sat, 4 Jul 2020 01:32:11 +0200 Subject: [PATCH] v3dv/device: add vendorID/deviceID get helpers As we would need them for the pipeline cache header. Part-of: --- src/broadcom/vulkan/v3dv_device.c | 32 +++++++++++++++++++++--------- src/broadcom/vulkan/v3dv_private.h | 2 ++ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index 6aea3cda183..4f8a9effa76 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -646,6 +646,27 @@ v3dv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, } } +uint32_t +v3dv_physical_device_vendor_id(struct v3dv_physical_device *dev) +{ + return 0x14E4; +} + + +/* FIXME: + * Getting deviceID and UUID will probably require to use the kernel pci + * interface. See this: + * https://www.kernel.org/doc/html/latest/PCI/pci.html#how-to-find-pci-devices-manually + * And check the getparam ioctl in the i915 kernel with CHIPSET_ID for + * example. + */ +uint32_t +v3dv_physical_device_device_id(struct v3dv_physical_device *dev) +{ + /* FIXME */ + return 0; +} + void v3dv_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) @@ -799,18 +820,11 @@ v3dv_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, .nonCoherentAtomSize = 256, }; - /* FIXME: - * Getting deviceID and UUID will probably require to use the kernel pci - * interface. See this: - * https://www.kernel.org/doc/html/latest/PCI/pci.html#how-to-find-pci-devices-manually - * And check the getparam ioctl in the i915 kernel with CHIPSET_ID for - * example. - */ *pProperties = (VkPhysicalDeviceProperties) { .apiVersion = v3dv_physical_device_api_version(pdevice), .driverVersion = vk_get_driver_version(), - .vendorID = 0x14E4, - .deviceID = 0, /* FIXME */ + .vendorID = v3dv_physical_device_vendor_id(pdevice), + .deviceID = v3dv_physical_device_device_id(pdevice), .deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, .limits = limits, .sparseProperties = { 0 }, diff --git a/src/broadcom/vulkan/v3dv_private.h b/src/broadcom/vulkan/v3dv_private.h index 94817aa841a..94cd443c04c 100644 --- a/src/broadcom/vulkan/v3dv_private.h +++ b/src/broadcom/vulkan/v3dv_private.h @@ -1616,6 +1616,8 @@ v3dv_zs_buffer(bool depth, bool stencil) } uint32_t v3dv_physical_device_api_version(struct v3dv_physical_device *dev); +uint32_t v3dv_physical_device_vendor_id(struct v3dv_physical_device *dev); +uint32_t v3dv_physical_device_device_id(struct v3dv_physical_device *dev); int v3dv_get_instance_entrypoint_index(const char *name); int v3dv_get_device_entrypoint_index(const char *name);