v3dv/device: add vendorID/deviceID get helpers
As we would need them for the pipeline cache header.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c
index 6aea3cd..4f8a9ef 100644
--- a/src/broadcom/vulkan/v3dv_device.c
+++ b/src/broadcom/vulkan/v3dv_device.c
@@ -646,6 +646,27 @@
}
}
+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 @@
.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 94817aa..94cd443 100644
--- a/src/broadcom/vulkan/v3dv_private.h
+++ b/src/broadcom/vulkan/v3dv_private.h
@@ -1616,6 +1616,8 @@
}
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);