turnip: Require DRM device version >= 1.3
authorChad Versace <chadversary@chromium.org>
Mon, 12 Nov 2018 22:13:13 +0000 (14:13 -0800)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 11 Mar 2019 17:01:33 +0000 (10:01 -0700)
Because the driver will require support for iova.

src/freedreno/vulkan/tu_device.c

index c5d94999600bcf6274f78b16487e77624f1f4241..f32868e9c812f42ebcbba1cbca0d64658db524a7 100644 (file)
@@ -87,6 +87,10 @@ tu_physical_device_init(struct tu_physical_device *device,
       return vk_error(instance, VK_ERROR_INCOMPATIBLE_DRIVER);
    }
 
+   /* Version 1.3 added MSM_INFO_IOVA. */
+   const int min_version_major = 1;
+   const int min_version_minor = 3;
+
    version = drmGetVersion(fd);
    if (!version) {
       close(fd);
@@ -112,6 +116,19 @@ tu_physical_device_init(struct tu_physical_device *device,
 
       return VK_ERROR_INCOMPATIBLE_DRIVER;
    }
+
+   if (version->version_major != 1 || version->version_minor < 3) {
+      result = vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
+                         "kernel driver for device %s has version %d.%d, "
+                         "but Vulkan requires version >= %d.%d",
+                         path,
+                         version->version_major, version->version_minor,
+                         min_version_major, min_version_minor);
+      drmFreeVersion(version);
+      close(fd);
+      return result;
+   }
+
    drmFreeVersion(version);
 
    if (instance->debug_flags & TU_DEBUG_STARTUP)