radv/vulkan: Move radv_get_driver_version to src/vulkan/util
[mesa.git] / src / amd / vulkan / radv_device.c
index ad4005ba61deef27f53410b3961ad914ef981966..5fdb894146cb1d3347248765ea20c7ccaba391dd 100644 (file)
@@ -33,7 +33,7 @@
 #include "radv_cs.h"
 #include "util/disk_cache.h"
 #include "util/strtod.h"
-#include "util/vk_util.h"
+#include "vk_util.h"
 #include <xf86drm.h>
 #include <amdgpu.h>
 #include <amdgpu_drm.h>
@@ -574,28 +574,6 @@ void radv_GetPhysicalDeviceFeatures2KHR(
        return radv_GetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features);
 }
 
-static uint32_t radv_get_driver_version()
-{
-       const char *minor_string = strchr(VERSION, '.');
-       const char *patch_string = minor_string ? strchr(minor_string + 1, ','): NULL;
-       int major = atoi(VERSION);
-       int minor = minor_string ? atoi(minor_string + 1) : 0;
-       int patch = patch_string ? atoi(patch_string + 1) : 0;
-       if (strstr(VERSION, "devel")) {
-               if (patch == 0) {
-                       patch = 99;
-                       if (minor == 0) {
-                               minor = 99;
-                               --major;
-                       } else
-                               --minor;
-               } else
-                       --patch;
-       }
-       uint32_t version = VK_MAKE_VERSION(major, minor, patch);
-       return version;
-}
-
 void radv_GetPhysicalDeviceProperties(
        VkPhysicalDevice                            physicalDevice,
        VkPhysicalDeviceProperties*                 pProperties)
@@ -731,10 +709,10 @@ void radv_GetPhysicalDeviceProperties(
 
        *pProperties = (VkPhysicalDeviceProperties) {
                .apiVersion = VK_MAKE_VERSION(1, 0, 42),
-               .driverVersion = radv_get_driver_version(),
+               .driverVersion = vk_get_driver_version(),
                .vendorID = 0x1002,
                .deviceID = pdevice->rad_info.pci_id,
-               .deviceType = VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU,
+               .deviceType = pdevice->rad_info.has_dedicated_vram ? VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU : VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU,
                .limits = limits,
                .sparseProperties = {0},
        };