From b6d7736792e79a6fb5990e0d66c3c1b3cdbc1d0c Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sat, 26 Apr 2025 22:13:35 +0800 Subject: [PATCH] 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 Part-of: --- src/gallium/drivers/zink/zink_screen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 05faeaf266c..4c937778a6a 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -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);