From ec2e78b3ff11ef33303b1ff6078ca760e1e1ece1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Fri, 14 Jan 2022 13:49:49 +0100 Subject: [PATCH] llvmpipe: Add get_{driver,device}_uuid implementations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 9da15aa3aa94 ("llvmpipe: enable EXT_memory_object(_fd)") enabled the extension, but left this unimplemented. Leaving this unimplemented causes segfaults for anyone trying to retrieve the UUIDs, as the calling code in the state tracker does not check if the function is implemented. This affects e.g. current Wine versions. Set the UUID to all zeros. Although this slightly violates the vulkan specification (since 1.2.146), the UUIDs have to match the ones from lavapipe (lvp_get_physical_device_properties_1_1). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5865 Fixes: 9da15aa3aa94 ("llvmpipe: enable EXT_memory_object(_fd)") Signed-off-by: Stefan BrĂ¼ns Reviewed-by: Dave Airlie airlied@redhat.com Part-of: (cherry picked from commit 537a0ee3b7f836564f5b4c05da7b13a27b226c46) --- .pick_status.json | 2 +- src/gallium/drivers/llvmpipe/lp_screen.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 4b4d6837127..aee6d949ff5 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2740,7 +2740,7 @@ "description": "llvmpipe: Add get_{driver,device}_uuid implementations", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "9da15aa3aa94bc94ca1492df8c444ff76b92d19d" }, diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 839902bb567..d308319af18 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -560,6 +560,18 @@ llvmpipe_get_compute_param(struct pipe_screen *_screen, return 0; } +static void +llvmpipe_get_driver_uuid(struct pipe_screen *pscreen, char *uuid) +{ + memset(uuid, 0, PIPE_UUID_SIZE); +} + +static void +llvmpipe_get_device_uuid(struct pipe_screen *pscreen, char *uuid) +{ + memset(uuid, 0, PIPE_UUID_SIZE); +} + static const struct nir_shader_compiler_options gallivm_nir_options = { .lower_scmp = true, .lower_flrp32 = true, @@ -1040,6 +1052,9 @@ llvmpipe_create_screen(struct sw_winsys *winsys) screen->base.get_timestamp = llvmpipe_get_timestamp; + screen->base.get_driver_uuid = llvmpipe_get_driver_uuid; + screen->base.get_device_uuid = llvmpipe_get_device_uuid; + screen->base.finalize_nir = llvmpipe_finalize_nir; screen->base.get_disk_shader_cache = lp_get_disk_shader_cache;