drm: Simplify drm_mm_clean()

Since commit ea7b1dd448 ("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
This commit is contained in:
Chris Wilson
2016-12-22 08:36:27 +00:00
committed by Daniel Vetter
parent c820186d5b
commit ac9bb7b7d3
2 changed files with 14 additions and 19 deletions

View File

@@ -342,7 +342,19 @@ void drm_mm_remove_node(struct drm_mm_node *node);
void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new);
void drm_mm_init(struct drm_mm *mm, u64 start, u64 size);
void drm_mm_takedown(struct drm_mm *mm);
bool drm_mm_clean(const struct drm_mm *mm);
/**
* drm_mm_clean - checks whether an allocator is clean
* @mm: drm_mm allocator to check
*
* Returns:
* True if the allocator is completely free, false if there's still a node
* allocated in it.
*/
static inline bool drm_mm_clean(const struct drm_mm *mm)
{
return list_empty(drm_mm_nodes(mm));
}
struct drm_mm_node *
__drm_mm_interval_first(const struct drm_mm *mm, u64 start, u64 last);