venus: check vn_renderer_info::vk_xml_version

When crosvm does not support venus, it still advertises
VIRGL_RENDERER_CAPSET_VENUS but provides no or zeroed capset data.
vk_xml_version will be zero.

It is a good idea to verify vk_xml_version anyway.

v2: print required version suggested by Ryan

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10192>
This commit is contained in:
Chia-I Wu 2021-04-09 22:49:21 -07:00 committed by Marge Bot
parent f86e0a519d
commit 51216d656d

View file

@ -191,6 +191,18 @@ vn_instance_init_renderer(struct vn_instance *instance)
version = vn_info_vk_xml_version();
if (instance->renderer_info.vk_xml_version > version)
instance->renderer_info.vk_xml_version = version;
if (instance->renderer_info.vk_xml_version < VN_MIN_RENDERER_VERSION) {
if (VN_DEBUG(INIT)) {
vn_log(instance, "vk xml version %d.%d.%d < %d.%d.%d",
VK_VERSION_MAJOR(instance->renderer_info.vk_xml_version),
VK_VERSION_MINOR(instance->renderer_info.vk_xml_version),
VK_VERSION_PATCH(instance->renderer_info.vk_xml_version),
VK_VERSION_MAJOR(VN_MIN_RENDERER_VERSION),
VK_VERSION_MINOR(VN_MIN_RENDERER_VERSION),
VK_VERSION_PATCH(VN_MIN_RENDERER_VERSION));
}
return VK_ERROR_INITIALIZATION_FAILED;
}
version = vn_info_extension_spec_version("VK_EXT_command_serialization");
if (instance->renderer_info.vk_ext_command_serialization_spec_version >