drm/mm: cleanup and improve next_hole_*_addr()
authorChristian König <christian.koenig@amd.com>
Mon, 15 Jun 2020 14:16:42 +0000 (16:16 +0200)
committerChristian König <christian.koenig@amd.com>
Tue, 23 Jun 2020 13:46:40 +0000 (15:46 +0200)
commit5fad79fd66ff90b8c0a95319dad0b099008f8347
tree7fe0bd6de4f603aebf0693154d096d20da2dd46f
parent271e7decd707accfe6d4965b2c5e60d2d77c8e35
drm/mm: cleanup and improve next_hole_*_addr()

Skipping just one branch of the tree is not the most
effective approach.

Instead use a macro to define the traversal functions and
sort out both branch sides.

This improves the performance of the unit tests by
a factor of more than 4.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nirmoy Das <nirmoy.das@amd.com>
Link: https://patchwork.freedesktop.org/patch/370298/
drivers/gpu/drm/drm_mm.c