Commit d2fb716a authored by Christian König's avatar Christian König

drm/mm: remove invalid entry based optimization

When the current entry is rejected as candidate for the search
it does not mean that we can abort the subtree search.

It is perfectly possible that only the alignment, but not the
size is the reason for the rejection.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Link: https://patchwork.freedesktop.org/patch/369394/
parent 72822c3b
......@@ -406,8 +406,7 @@ next_hole_high_addr(struct drm_mm_node *entry, u64 size)
parent_rb_node = rb_parent(rb_node);
left_node = rb_entry(left_rb_node,
struct drm_mm_node, rb_hole_addr);
if ((left_node->subtree_max_hole < size ||
HOLE_SIZE(entry) == entry->subtree_max_hole) &&
if (left_node->subtree_max_hole < size &&
parent_rb_node && parent_rb_node->rb_left != rb_node)
return rb_hole_addr_to_node(parent_rb_node);
}
......@@ -446,8 +445,7 @@ next_hole_low_addr(struct drm_mm_node *entry, u64 size)
parent_rb_node = rb_parent(rb_node);
right_node = rb_entry(right_rb_node,
struct drm_mm_node, rb_hole_addr);
if ((right_node->subtree_max_hole < size ||
HOLE_SIZE(entry) == entry->subtree_max_hole) &&
if (right_node->subtree_max_hole < size &&
parent_rb_node && parent_rb_node->rb_right != rb_node)
return rb_hole_addr_to_node(parent_rb_node);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment