diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-08-26 06:03:18 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-08-26 06:03:18 +0000 |
commit | af5e8f5366b05c3d4f8521f318c143a5c5dc3ea9 (patch) | |
tree | c5691445908b1beca9facf0e5e3c5d7f35f74228 /lib/mesa/src/gallium/auxiliary/util/u_debug_flush.c | |
parent | 27c93456b58343162f7c4ad20ca6bea0c9a91646 (diff) |
Merge Mesa 20.1.6
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/util/u_debug_flush.c')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/util/u_debug_flush.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_debug_flush.c b/lib/mesa/src/gallium/auxiliary/util/u_debug_flush.c index cc60ab1d7..b8f6870f0 100644 --- a/lib/mesa/src/gallium/auxiliary/util/u_debug_flush.c +++ b/lib/mesa/src/gallium/auxiliary/util/u_debug_flush.c @@ -51,7 +51,7 @@ #include <stdio.h> /* Future improvement: Use realloc instead? */ -#define DEBUG_FLUSH_MAP_DEPTH 16 +#define DEBUG_FLUSH_MAP_DEPTH 32 struct debug_map_item { struct debug_stack_frame *frame; @@ -82,7 +82,7 @@ struct debug_flush_ctx { /* Contexts are used by a single thread at a time */ unsigned bt_depth; boolean catch_map_of_referenced; - struct util_hash_table *ref_hash; + struct hash_table *ref_hash; struct list_head head; }; @@ -102,18 +102,6 @@ debug_flush_capture_frame(int start, int depth) return frames; } -static int -debug_flush_pointer_compare(void *key1, void *key2) -{ - return (key1 == key2) ? 0 : 1; -} - -static unsigned -debug_flush_pointer_hash(void *key) -{ - return (unsigned) (unsigned long) key; -} - struct debug_flush_buf * debug_flush_buf_create(boolean supports_persistent, unsigned bt_depth) { @@ -171,8 +159,7 @@ debug_flush_ctx_create(UNUSED boolean catch_reference_of_mapped, if (!fctx) goto out_no_ctx; - fctx->ref_hash = util_hash_table_create(debug_flush_pointer_hash, - debug_flush_pointer_compare); + fctx->ref_hash = util_hash_table_create_ptr_keys(); if (!fctx->ref_hash) goto out_no_ref_hash; @@ -336,10 +323,7 @@ debug_flush_cb_reference(struct debug_flush_ctx *fctx, debug_flush_buf_reference(&item->fbuf, fbuf); item->bt_depth = fctx->bt_depth; item->ref_frame = debug_flush_capture_frame(2, item->bt_depth); - if (util_hash_table_set(fctx->ref_hash, fbuf, item) != PIPE_OK) { - debug_flush_item_destroy(item); - goto out_no_item; - } + _mesa_hash_table_insert(fctx->ref_hash, fbuf, item); return; } goto out_no_item; @@ -422,7 +406,7 @@ debug_flush_flush(struct debug_flush_ctx *fctx) util_hash_table_foreach(fctx->ref_hash, debug_flush_flush_cb, NULL); - util_hash_table_clear(fctx->ref_hash); + _mesa_hash_table_clear(fctx->ref_hash, NULL); } void @@ -435,8 +419,8 @@ debug_flush_ctx_destroy(struct debug_flush_ctx *fctx) util_hash_table_foreach(fctx->ref_hash, debug_flush_flush_cb, NULL); - util_hash_table_clear(fctx->ref_hash); - util_hash_table_destroy(fctx->ref_hash); + _mesa_hash_table_clear(fctx->ref_hash, NULL); + _mesa_hash_table_destroy(fctx->ref_hash, NULL); FREE(fctx); } #endif |