aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_mm.h
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2013-07-05 17:41:02 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-07-08 16:04:32 -0400
commitb3a070cccb9135f8bec63d9f194ddaa422136fb0 (patch)
tree64459a4af873cf5a1db2ddcd1d86d3bea24d7a38 /include/drm/drm_mm.h
parentb79480ba5074ae81d1c32073bce3981652e0f717 (diff)
drm: pre allocate node for create_block
For an upcoming patch where we introduce the i915 VMA, it's ideal to have the drm_mm_node as part of the VMA struct (ie. it's pre-allocated). Part of the conversion to VMAs is to kill off obj->gtt_space. Doing this will break a bunch of code, but amongst them are 2 callers of drm_mm_create_block(), both related to stolen memory. It also allows us to embed the drm_mm_node into the object currently which provides a nice transition over to the new code. v2: Reordered to do before ripping out obj->gtt_offset. Some minor cleanups made available because of reordering. v3: s/continue/break on failed stolen node allocation (David) Set obj->gtt_space on failed node allocation (David) Only unref stolen (fix double free) on failed create_stolen (David) Free node, and NULL it in failed create_stolen (David) Add back accidentally removed newline (David) CC: <dri-devel@lists.freedesktop.org> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Acked-by: David Airlie <airlied@linux.ie> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drm_mm.h')
-rw-r--r--include/drm/drm_mm.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 88591ef8fa24..d8b56b7d1839 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -138,10 +138,10 @@ static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
138/* 138/*
139 * Basic range manager support (drm_mm.c) 139 * Basic range manager support (drm_mm.c)
140 */ 140 */
141extern struct drm_mm_node *drm_mm_create_block(struct drm_mm *mm, 141extern int drm_mm_create_block(struct drm_mm *mm,
142 unsigned long start, 142 struct drm_mm_node *node,
143 unsigned long size, 143 unsigned long start,
144 bool atomic); 144 unsigned long size);
145extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, 145extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node,
146 unsigned long size, 146 unsigned long size,
147 unsigned alignment, 147 unsigned alignment,
@@ -155,6 +155,7 @@ extern struct drm_mm_node *drm_mm_get_block_range_generic(
155 unsigned long start, 155 unsigned long start,
156 unsigned long end, 156 unsigned long end,
157 int atomic); 157 int atomic);
158
158static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent, 159static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent,
159 unsigned long size, 160 unsigned long size,
160 unsigned alignment) 161 unsigned alignment)