From: Chad Versace Date: Mon, 12 Nov 2018 22:13:13 +0000 (-0800) Subject: turnip: Require DRM device version >= 1.3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cca208a0330f72d1cba7f679cf78e1121ee23d7b;p=mesa.git turnip: Require DRM device version >= 1.3 Because the driver will require support for iova. --- 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)