Mesa (main): llvmpipe: add user memory resources to the debug global list.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 28 01:37:21 UTC 2022


Module: Mesa
Branch: main
Commit: b4bbf9d1acf04debb0abd2c3ebeac21fe389cf83
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4bbf9d1acf04debb0abd2c3ebeac21fe389cf83

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Apr 28 10:43:45 2022 +1000

llvmpipe: add user memory resources to the debug global list.

Otherwise things will crash on destruction.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Fixes: 9a57dceeb760 ("llvmpipe: add support for user memory pointers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16207>

---

 src/gallium/drivers/llvmpipe/lp_texture.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index e206f5091c9..c68f175db72 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -656,6 +656,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);
+   list_addtail(&lpr->list, &resource_list.list);
+   mtx_unlock(&resource_list_mutex);
+#endif
    return &lpr->base;
 fail:
    FREE(lpr);



More information about the mesa-commit mailing list