wsi/headless: Override finish_create

Since headless overrides create_mem, it needs to override finish_create
too. Fixes a segfault in nvk that was caused by us mixing
wsi_create_null_image_mem with wsi_finish_create_blit_context, which
would then call CmdCopyImageToBuffer with image->blit.buffer == NULL

Fixes a cts failure on nvk in:
dEQP-VK.image.swapchain_mutable.headless.2d.r8g8b8a8_unorm_b8g8r8a8_unorm_clear_copy_format_list
and several others

Fixes: 579578f10a ("vulkan/wsi/drm: Break create_prime_image in pieces")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34646>
(cherry picked from commit 60452e016ecd9f84ca9336d81a8f549b7a27f27a)
This commit is contained in:
Mel Henning
2025-04-21 20:50:43 -04:00
committed by Eric Engestrom
parent 3619611b31
commit a7dae0fec8
2 changed files with 2 additions and 1 deletions

View File

@@ -694,7 +694,7 @@
"description": "wsi/headless: Override finish_create",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "579578f10acda284c39cab2b12ccb8de2d2f793c",
"notes": null

View File

@@ -472,6 +472,7 @@ wsi_headless_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
chain->extent = pCreateInfo->imageExtent;
chain->vk_format = pCreateInfo->imageFormat;
chain->base.image_info.create_mem = wsi_create_null_image_mem;
chain->base.image_info.finish_create = NULL;
for (uint32_t i = 0; i < chain->base.image_count; i++) {