From cca208a0330f72d1cba7f679cf78e1121ee23d7b Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Mon, 12 Nov 2018 14:13:13 -0800 Subject: [PATCH] turnip: Require DRM device version >= 1.3 Because the driver will require support for iova. --- src/freedreno/vulkan/tu_device.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index c5d94999600..f32868e9c81 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -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) -- 2.30.2