Commit 18ece75d authored by Nirmoy Das's avatar Nirmoy Das Committed by Christian König

drm/mm: fix hole size comparison

Fixes: 0cdea445 ("drm/mm: optimize rb_hole_addr rbtree search")
Signed-off-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Reported-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/367726/
parent ba931cfd
...@@ -407,7 +407,7 @@ next_hole_high_addr(struct drm_mm_node *entry, u64 size) ...@@ -407,7 +407,7 @@ next_hole_high_addr(struct drm_mm_node *entry, u64 size)
left_node = rb_entry(left_rb_node, left_node = rb_entry(left_rb_node,
struct drm_mm_node, rb_hole_addr); struct drm_mm_node, rb_hole_addr);
if ((left_node->subtree_max_hole < size || if ((left_node->subtree_max_hole < size ||
entry->size == entry->subtree_max_hole) && HOLE_SIZE(entry) == entry->subtree_max_hole) &&
parent_rb_node && parent_rb_node->rb_left != rb_node) parent_rb_node && parent_rb_node->rb_left != rb_node)
return rb_hole_addr_to_node(parent_rb_node); return rb_hole_addr_to_node(parent_rb_node);
} }
...@@ -447,7 +447,7 @@ next_hole_low_addr(struct drm_mm_node *entry, u64 size) ...@@ -447,7 +447,7 @@ next_hole_low_addr(struct drm_mm_node *entry, u64 size)
right_node = rb_entry(right_rb_node, right_node = rb_entry(right_rb_node,
struct drm_mm_node, rb_hole_addr); struct drm_mm_node, rb_hole_addr);
if ((right_node->subtree_max_hole < size || if ((right_node->subtree_max_hole < size ||
entry->size == entry->subtree_max_hole) && HOLE_SIZE(entry) == entry->subtree_max_hole) &&
parent_rb_node && parent_rb_node->rb_right != rb_node) parent_rb_node && parent_rb_node->rb_right != rb_node)
return rb_hole_addr_to_node(parent_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