From ffee4657014f66ee3d74aee5fb1c34a683ee65d9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 2 Mar 2022 08:48:52 -0500 Subject: [PATCH] zink: wait on program cache fences before destroying programs if these still have outstanding cache jobs, deleting the object now will cause a crash maybe fixes some cts flakiness? cc: mesa-stable Acked-by: Emma Anholt Reviewed-by: Dave Airlie Part-of: (cherry picked from commit c5f585f45afdde8c453c57dad744fd51caf6a699) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_program.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index eb6699d359b..a12b46010f1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1669,7 +1669,7 @@ "description": "zink: wait on program cache fences before destroying programs", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 6e69c0cb461..a6c69797954 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -557,6 +557,7 @@ void zink_destroy_gfx_program(struct zink_screen *screen, struct zink_gfx_program *prog) { + util_queue_fence_wait(&prog->base.cache_fence); if (prog->base.layout) VKSCR(DestroyPipelineLayout)(screen->dev, prog->base.layout, NULL); @@ -601,6 +602,7 @@ void zink_destroy_compute_program(struct zink_screen *screen, struct zink_compute_program *comp) { + util_queue_fence_wait(&comp->base.cache_fence); if (comp->base.layout) VKSCR(DestroyPipelineLayout)(screen->dev, comp->base.layout, NULL);