From a5c5421f9d19e31800788752dfa1f585e6b6c2d5 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 28 Apr 2022 10:43:45 +1000 Subject: [PATCH] llvmpipe: add user memory resources to the debug global list. Otherwise things will crash on destruction. Reviewed-by: Mike Blumenkrantz Fixes: 9a57dceeb760 ("llvmpipe: add support for user memory pointers") Part-of: (cherry picked from commit b4bbf9d1acf04debb0abd2c3ebeac21fe389cf83) --- .pick_status.json | 2 +- src/gallium/drivers/llvmpipe/lp_texture.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index f4c922c038b..1907cbffcbc 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -196,7 +196,7 @@ "description": "llvmpipe: add user memory resources to the debug global list.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "because_sha": "9a57dceeb760a1d4f7d9d1666bec0844ee41852e" }, { diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 8555b9ec761..57f3298be82 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -657,6 +657,11 @@ llvmpipe_resource_from_user_memory(struct pipe_screen *_screen, } else lpr->data = user_memory; lpr->user_ptr = true; +#ifdef DEBUG + mtx_lock(&resource_list_mutex); + insert_at_tail(&resource_list, lpr); + mtx_unlock(&resource_list_mutex); +#endif return &lpr->base; fail: FREE(lpr);