From e67c2e1c96c17b5b57f214297adba2a8a302f994 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 17 Jun 2020 11:25:17 -0700 Subject: [PATCH] turnip: Do better TU_DEBUG=startup logging of drmGetDevices2() failure. Part-of: --- src/freedreno/vulkan/tu_device.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 43ed5f6e4a8..dd046f39eef 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -501,8 +501,12 @@ tu_enumerate_devices(struct tu_instance *instance) max_devices = drmGetDevices2(0, devices, ARRAY_SIZE(devices)); - if (instance->debug_flags & TU_DEBUG_STARTUP) - tu_logi("Found %d drm nodes", max_devices); + if (instance->debug_flags & TU_DEBUG_STARTUP) { + if (max_devices < 0) + tu_logi("drmGetDevices2 returned error: %s\n", strerror(max_devices)); + else + tu_logi("Found %d drm nodes", max_devices); + } if (max_devices < 1) return vk_error(instance, VK_ERROR_INCOMPATIBLE_DRIVER); -- 2.30.2