diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-21 09:21:29 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-24 15:04:30 +0100 |
commit | 83bc4ec37210b17bd611a58968b2ce0e9cc7f251 (patch) | |
tree | 16ec4cb4c765fd6a76ef10c9b63522d2b03780bc /drivers/gpu/drm/selftests/drm_mm_selftests.h | |
parent | 2f7e87692e0441abf27a9714991edd136e87363a (diff) | |
download | linux-stable-83bc4ec37210b17bd611a58968b2ce0e9cc7f251.tar.gz linux-stable-83bc4ec37210b17bd611a58968b2ce0e9cc7f251.tar.bz2 linux-stable-83bc4ec37210b17bd611a58968b2ce0e9cc7f251.zip |
drm/mm: Add a search-by-address variant to only inspect a single hole
Searching for an available hole by address is slow, as there no
guarantee that a hole will be available and so we must walk over all
nodes in the rbtree before we determine the search was futile. In many
cases, the caller doesn't strictly care for the highest available hole
and was just opportunistically laying out the address space in a
preferred order. In such cases, the caller can accept any address and
would rather do so then do a slow walk.
To be able to mix search strategies, the caller wants to tell the drm_mm
how long to spend on the search. Without a good guide for what should be
the best split, start with a request to try once at most. That is return
the top-most (or lowest) hole if it fulfils the alignment and size
requirements.
v2: Documentation, by why of example (selftests) and kerneldoc.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180521082131.13744-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/selftests/drm_mm_selftests.h')
-rw-r--r-- | drivers/gpu/drm/selftests/drm_mm_selftests.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/selftests/drm_mm_selftests.h b/drivers/gpu/drm/selftests/drm_mm_selftests.h index 54acc117550c..6b943ea1c57d 100644 --- a/drivers/gpu/drm/selftests/drm_mm_selftests.h +++ b/drivers/gpu/drm/selftests/drm_mm_selftests.h @@ -19,7 +19,9 @@ selftest(align64, igt_align64) selftest(evict, igt_evict) selftest(evict_range, igt_evict_range) selftest(bottomup, igt_bottomup) +selftest(lowest, igt_lowest) selftest(topdown, igt_topdown) +selftest(highest, igt_highest) selftest(color, igt_color) selftest(color_evict, igt_color_evict) selftest(color_evict_range, igt_color_evict_range) |