diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-12-22 03:36:27 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-27 08:16:59 -0500 |
commit | ac9bb7b7d33f6be9e333b24786a774145cc8c59e (patch) | |
tree | e65f935a8201865a8dfea93b1997b6d4570feb19 /include/drm/drm_mm.h | |
parent | c820186d5b3b213c5a627c45e5db386bb739af25 (diff) |
drm: Simplify drm_mm_clean()
Since commit ea7b1dd44867 ("drm: mm: track free areas implicitly"),
to test whether there are any nodes allocated within the range manager,
we merely have to ask whether the node_list is empty.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161222083641.2691-25-chris@chris-wilson.co.uk
Diffstat (limited to 'include/drm/drm_mm.h')
-rw-r--r-- | include/drm/drm_mm.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 7eeb98b5bf70..72e0c0ddf8d0 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
@@ -342,7 +342,19 @@ void drm_mm_remove_node(struct drm_mm_node *node); | |||
342 | void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new); | 342 | void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new); |
343 | void drm_mm_init(struct drm_mm *mm, u64 start, u64 size); | 343 | void drm_mm_init(struct drm_mm *mm, u64 start, u64 size); |
344 | void drm_mm_takedown(struct drm_mm *mm); | 344 | void drm_mm_takedown(struct drm_mm *mm); |
345 | bool drm_mm_clean(const struct drm_mm *mm); | 345 | |
346 | /** | ||
347 | * drm_mm_clean - checks whether an allocator is clean | ||
348 | * @mm: drm_mm allocator to check | ||
349 | * | ||
350 | * Returns: | ||
351 | * True if the allocator is completely free, false if there's still a node | ||
352 | * allocated in it. | ||
353 | */ | ||
354 | static inline bool drm_mm_clean(const struct drm_mm *mm) | ||
355 | { | ||
356 | return list_empty(drm_mm_nodes(mm)); | ||
357 | } | ||
346 | 358 | ||
347 | struct drm_mm_node * | 359 | struct drm_mm_node * |
348 | __drm_mm_interval_first(const struct drm_mm *mm, u64 start, u64 last); | 360 | __drm_mm_interval_first(const struct drm_mm *mm, u64 start, u64 last); |