aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2009-12-07 09:52:56 -0500
committerDave Airlie <airlied@redhat.com>2009-12-10 00:09:01 -0500
commita2e68e92d384d37c8cc6bb7206d43b1eb9bc3f08 (patch)
tree5050cb18d00830a3f80ad650f8c16ed40953399c /include
parentcf2f05d30dacab32e6866347be6cbfa4030b33b7 (diff)
drm: Add search/get functions to get a block in a specific range
These are required for changes to TTM. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_mm.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 62329f9a42cb..b40b2f062039 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -66,6 +66,13 @@ extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node,
66 unsigned long size, 66 unsigned long size,
67 unsigned alignment, 67 unsigned alignment,
68 int atomic); 68 int atomic);
69extern struct drm_mm_node *drm_mm_get_block_range_generic(
70 struct drm_mm_node *node,
71 unsigned long size,
72 unsigned alignment,
73 unsigned long start,
74 unsigned long end,
75 int atomic);
69static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent, 76static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent,
70 unsigned long size, 77 unsigned long size,
71 unsigned alignment) 78 unsigned alignment)
@@ -78,11 +85,38 @@ static inline struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *pa
78{ 85{
79 return drm_mm_get_block_generic(parent, size, alignment, 1); 86 return drm_mm_get_block_generic(parent, size, alignment, 1);
80} 87}
88static inline struct drm_mm_node *drm_mm_get_block_range(
89 struct drm_mm_node *parent,
90 unsigned long size,
91 unsigned alignment,
92 unsigned long start,
93 unsigned long end)
94{
95 return drm_mm_get_block_range_generic(parent, size, alignment,
96 start, end, 0);
97}
98static inline struct drm_mm_node *drm_mm_get_block_atomic_range(
99 struct drm_mm_node *parent,
100 unsigned long size,
101 unsigned alignment,
102 unsigned long start,
103 unsigned long end)
104{
105 return drm_mm_get_block_range_generic(parent, size, alignment,
106 start, end, 1);
107}
81extern void drm_mm_put_block(struct drm_mm_node *cur); 108extern void drm_mm_put_block(struct drm_mm_node *cur);
82extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, 109extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
83 unsigned long size, 110 unsigned long size,
84 unsigned alignment, 111 unsigned alignment,
85 int best_match); 112 int best_match);
113extern struct drm_mm_node *drm_mm_search_free_in_range(
114 const struct drm_mm *mm,
115 unsigned long size,
116 unsigned alignment,
117 unsigned long start,
118 unsigned long end,
119 int best_match);
86extern int drm_mm_init(struct drm_mm *mm, unsigned long start, 120extern int drm_mm_init(struct drm_mm *mm, unsigned long start,
87 unsigned long size); 121 unsigned long size);
88extern void drm_mm_takedown(struct drm_mm *mm); 122extern void drm_mm_takedown(struct drm_mm *mm);