From c75e89962e4d1e293bc22bc4deedd2a3d4f91cd5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 3 Mar 2022 12:25:41 -0500 Subject: [PATCH] zink: invalidate non-punted recycled descriptor sets that are not valid these sets may contain refs from the descriptors which need to be removed to avoid invalid memory access if the ref is leaked cc: mesa-stable Acked-by: Emma Anholt Reviewed-by: Dave Airlie Part-of: (cherry picked from commit e0030bc39f87dde018add3dfb256d2cfd1a7859e) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_descriptors.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 96c440e25a7..dcd08ebe6e2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -445,7 +445,7 @@ "description": "zink: invalidate non-punted recycled descriptor sets that are not valid", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index 87dca30105d..f60e0913f57 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -850,6 +850,8 @@ zink_descriptor_set_get(struct zink_context *ctx, zds = (void*)he->data; *cache_hit = !zds->invalid; if (recycled) { + if (zds->invalid) + descriptor_set_invalidate(zds); /* need to migrate this entry back to the in-use hash */ _mesa_hash_table_remove(pool->free_desc_sets, he); goto out;