From b9994cb8d518235649544fadbf24ab3763d96f39 Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Mon, 30 Sep 2019 12:34:12 -0700 Subject: [PATCH] intel/tools: Fix aubinator usage of rb_tree. The order of comparison has changed, so we need to invert the logic of "insert_left" when using rb_tree_insert_at(). Fixes: dae33052dbf (util/rb_tree: Reverse the order of comparison functions). Reviewed-by: Jason Ekstrand --- src/intel/tools/aub_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/tools/aub_mem.c b/src/intel/tools/aub_mem.c index 2f70afc8b76..5dd1c618443 100644 --- a/src/intel/tools/aub_mem.c +++ b/src/intel/tools/aub_mem.c @@ -109,7 +109,7 @@ ensure_ggtt_entry(struct aub_mem *mem, uint64_t virt_addr) if (!node || (cmp = cmp_ggtt_entry(node, &virt_addr))) { struct ggtt_entry *new_entry = calloc(1, sizeof(*new_entry)); new_entry->virt_addr = virt_addr; - rb_tree_insert_at(&mem->ggtt, node, &new_entry->node, cmp > 0); + rb_tree_insert_at(&mem->ggtt, node, &new_entry->node, cmp < 0); node = &new_entry->node; } @@ -153,7 +153,7 @@ ensure_phys_mem(struct aub_mem *mem, uint64_t phys_addr) mem->mem_fd, new_mem->fd_offset); assert(new_mem->data != MAP_FAILED); - rb_tree_insert_at(&mem->mem, node, &new_mem->node, cmp > 0); + rb_tree_insert_at(&mem->mem, node, &new_mem->node, cmp < 0); node = &new_mem->node; } -- 2.30.2