venus: log upon device creation
authorYiwei Zhang <zzyiwei@chromium.org>
Wed, 1 Feb 2023 01:12:23 +0000 (17:12 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 1 Feb 2023 22:04:41 +0000 (22:04 +0000)
Log the deviceName and driverInfo gated behind VN_DEBUG=log_ctx_info

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21030>

src/virtio/vulkan/vn_common.c
src/virtio/vulkan/vn_common.h
src/virtio/vulkan/vn_device.c

index 82f4af1..79d205d 100644 (file)
@@ -27,6 +27,7 @@ static const struct debug_control vn_debug_options[] = {
    { "vtest", VN_DEBUG_VTEST },
    { "wsi", VN_DEBUG_WSI },
    { "no_abort", VN_DEBUG_NO_ABORT },
+   { "log_ctx_info", VN_DEBUG_LOG_CTX_INFO },
    { NULL, 0 },
    /* clang-format on */
 };
index 65c8546..881fff7 100644 (file)
@@ -101,6 +101,7 @@ enum vn_debug {
    VN_DEBUG_VTEST = 1ull << 2,
    VN_DEBUG_WSI = 1ull << 3,
    VN_DEBUG_NO_ABORT = 1ull << 4,
+   VN_DEBUG_LOG_CTX_INFO = 1ull << 5,
 };
 
 enum vn_perf {
index a734edb..eb0d5e2 100644 (file)
@@ -481,6 +481,11 @@ vn_CreateDevice(VkPhysicalDevice physicalDevice,
       return vn_error(instance, result);
    }
 
+   if (VN_DEBUG(LOG_CTX_INFO)) {
+      vn_log(instance, "%s", physical_dev->properties.vulkan_1_0.deviceName);
+      vn_log(instance, "%s", physical_dev->properties.vulkan_1_2.driverInfo);
+   }
+
    *pDevice = vn_device_to_handle(dev);
 
    return VK_SUCCESS;