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;
}
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;
}