Quoting Chris Wilson (2018-02-19 10:57:27)
> When we descend the tree to find our slot, if we step to the right, we
> are no longer the leftmost node.
> 
> Fixes: f808c13fd373 ("lib/interval_tree: fast overlap detection")
> Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
> Cc: Davidlohr Bueso <dbu...@suse.de>
> Cc: Jérôme Glisse <jgli...@redhat.com>
> Cc: Christian König <christian.koe...@amd.com>

<SNIP>

> @@ -208,11 +209,11 @@ static void drm_mm_interval_tree_add_node(struct 
> drm_mm_node *hole_node,
>                 parent = rb_entry(rb, struct drm_mm_node, rb);
>                 if (parent->__subtree_last < node->__subtree_last)
>                         parent->__subtree_last = node->__subtree_last;
> -               if (node->start < parent->start)
> +               if (node->start < parent->start) {
>                         link = &parent->rb.rb_left;
> -               else {
> +               } else {
>                         link = &parent->rb.rb_right;
> -                       leftmost = true;
> +                       leftmost = false;

As this bug didn't have any functional effect, we could go with
rb_insert_augmented and not try to cache the node if the information
ends up being unused.

Reviewed-by: Joonas Lahtinen <joonas.lahti...@linux.intel.com>

Regards, Joonas
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to