summaryrefslogtreecommitdiff
path: root/include/drm/drm_mm.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-22 11:36:39 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-28 15:51:20 +0300
commitadb040b86bc290d3d8a339ad8e91c96a9f506095 (patch)
treedf38764a3551e292f85f521bb363cceabad11e8e /include/drm/drm_mm.h
parent3db93756b501e5f0a3951c79cfa9ed43c26d3455 (diff)
downloadlinux-adb040b86bc290d3d8a339ad8e91c96a9f506095.tar.xz
drm: Use drm_mm_insert_node_in_range_generic() for everyone
Remove a superfluous helper as drm_mm_insert_node is equivalent to insert_node_in_range with a range of [0, U64_MAX]. 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-37-chris@chris-wilson.co.uk
Diffstat (limited to 'include/drm/drm_mm.h')
-rw-r--r--include/drm/drm_mm.h90
1 files changed, 56 insertions, 34 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 7da7a171d6d5..92ec5759caae 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -285,40 +285,6 @@ static inline u64 drm_mm_hole_node_end(const struct drm_mm_node *hole_node)
* Basic range manager support (drm_mm.c)
*/
int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node);
-
-int drm_mm_insert_node_generic(struct drm_mm *mm,
- struct drm_mm_node *node,
- u64 size,
- u64 alignment,
- unsigned long color,
- enum drm_mm_search_flags sflags,
- enum drm_mm_allocator_flags aflags);
-/**
- * drm_mm_insert_node - search for space and insert @node
- * @mm: drm_mm to allocate from
- * @node: preallocate node to insert
- * @size: size of the allocation
- * @alignment: alignment of the allocation
- * @flags: flags to fine-tune the allocation
- *
- * This is a simplified version of drm_mm_insert_node_generic() with @color set
- * to 0.
- *
- * The preallocated node must be cleared to 0.
- *
- * Returns:
- * 0 on success, -ENOSPC if there's no suitable hole.
- */
-static inline int drm_mm_insert_node(struct drm_mm *mm,
- struct drm_mm_node *node,
- u64 size,
- u64 alignment,
- enum drm_mm_search_flags flags)
-{
- return drm_mm_insert_node_generic(mm, node, size, alignment, 0, flags,
- DRM_MM_CREATE_DEFAULT);
-}
-
int drm_mm_insert_node_in_range_generic(struct drm_mm *mm,
struct drm_mm_node *node,
u64 size,
@@ -328,6 +294,7 @@ int drm_mm_insert_node_in_range_generic(struct drm_mm *mm,
u64 end,
enum drm_mm_search_flags sflags,
enum drm_mm_allocator_flags aflags);
+
/**
* drm_mm_insert_node_in_range - ranged search for space and insert @node
* @mm: drm_mm to allocate from
@@ -359,6 +326,61 @@ static inline int drm_mm_insert_node_in_range(struct drm_mm *mm,
DRM_MM_CREATE_DEFAULT);
}
+/**
+ * drm_mm_insert_node_generic - search for space and insert @node
+ * @mm: drm_mm to allocate from
+ * @node: preallocate node to insert
+ * @size: size of the allocation
+ * @alignment: alignment of the allocation
+ * @color: opaque tag value to use for this node
+ * @sflags: flags to fine-tune the allocation search
+ * @aflags: flags to fine-tune the allocation behavior
+ *
+ * The preallocated node must be cleared to 0.
+ *
+ * Returns:
+ * 0 on success, -ENOSPC if there's no suitable hole.
+ */
+static inline int
+drm_mm_insert_node_generic(struct drm_mm *mm, struct drm_mm_node *node,
+ u64 size, u64 alignment,
+ unsigned long color,
+ enum drm_mm_search_flags sflags,
+ enum drm_mm_allocator_flags aflags)
+{
+ return drm_mm_insert_node_in_range_generic(mm, node,
+ size, alignment, 0,
+ 0, U64_MAX,
+ sflags, aflags);
+}
+
+/**
+ * drm_mm_insert_node - search for space and insert @node
+ * @mm: drm_mm to allocate from
+ * @node: preallocate node to insert
+ * @size: size of the allocation
+ * @alignment: alignment of the allocation
+ * @flags: flags to fine-tune the allocation
+ *
+ * This is a simplified version of drm_mm_insert_node_generic() with @color set
+ * to 0.
+ *
+ * The preallocated node must be cleared to 0.
+ *
+ * Returns:
+ * 0 on success, -ENOSPC if there's no suitable hole.
+ */
+static inline int drm_mm_insert_node(struct drm_mm *mm,
+ struct drm_mm_node *node,
+ u64 size,
+ u64 alignment,
+ enum drm_mm_search_flags flags)
+{
+ return drm_mm_insert_node_generic(mm, node,
+ size, alignment, 0,
+ flags, DRM_MM_CREATE_DEFAULT);
+}
+
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);