[PATCH] drm: should break if already get the best size

Monk Liu Monk.Liu at amd.com
Thu Nov 22 12:33:06 UTC 2018


Signed-off-by: Monk Liu <Monk.Liu at amd.com>
---
 drivers/gpu/drm/drm_mm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 3cc5fbd..369fd9b 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -318,6 +318,8 @@ static struct drm_mm_node *best_hole(struct drm_mm *mm, u64 size)
 		if (size <= node->hole_size) {
 			best = node;
 			rb = rb->rb_right;
+			if (size == node->hole_size)
+				break;
 		} else {
 			rb = rb->rb_left;
 		}
-- 
2.7.4



More information about the amd-gfx mailing list