zink: reject IMG blob < 24.1@6554834 unless enforced

Imagination closed blobs earlier than 24.1@6554834 has some issues about
NULL pCommandBuffers in VkSubmitInfo, which is present in VkSubmitInfo's
submitted by Zink.

Reject these drivers to prevent crashes, unless zink is enforced and the
user knows what they're doing.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34183>
This commit is contained in:
Icenowy Zheng
2025-04-26 22:13:35 +08:00
committed by Marge Bot
parent 45d9d55cc1
commit b6d7736792
+7
View File
@@ -3406,6 +3406,13 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
goto fail;
}
/* Reject IMG blobs with DDK below 24.1@6554834 if not forced */
if (zink_driverid(screen) == VK_DRIVER_ID_IMAGINATION_PROPRIETARY && screen->info.props.driverVersion < 6554834) {
debug_printf("zink: Imagination proprietary driver is too old to be supported, expect failure\n");
if (screen->driver_name_is_inferred)
goto fail;
}
if (zink_debug & ZINK_DEBUG_MEM) {
simple_mtx_init(&screen->debug_mem_lock, mtx_plain);
screen->debug_mem_sizes = _mesa_hash_table_create(screen, _mesa_hash_string, _mesa_key_string_equal);