Lines Matching defs:node

85 	struct drm_mm_node *node;
90 node = kzalloc(sizeof(*node), GFP_KERNEL);
93 if (unlikely(node == NULL)) {
99 list_add_tail(&node->node_list, &mm->unused_nodes, (caddr_t)node);
106 struct drm_mm_node *node,
116 BUG_ON(node->allocated);
132 node->start = adj_start;
133 node->size = size;
134 node->mm = mm;
135 node->color = color;
136 node->allocated = 1;
138 INIT_LIST_HEAD(&node->hole_stack);
139 list_add(&node->node_list, &hole_node->node_list, (caddr_t)node);
141 BUG_ON(node->start + node->size > adj_end);
143 node->hole_follows = 0;
144 if (__drm_mm_hole_node_start(node) < hole_end) {
145 list_add(&node->hole_stack, &mm->hole_stack, (caddr_t)node);
146 node->hole_follows = 1;
155 struct drm_mm_node *hole, *node;
164 node = drm_mm_kmalloc(mm, atomic);
165 if (unlikely(node == NULL))
168 node->start = start;
169 node->size = size;
170 node->mm = mm;
171 node->allocated = 1;
173 INIT_LIST_HEAD(&node->hole_stack);
174 list_add(&node->node_list, &hole->node_list, (caddr_t)node);
181 node->hole_follows = 0;
183 list_add(&node->hole_stack, &mm->hole_stack, (caddr_t)node);
184 node->hole_follows = 1;
187 return node;
200 struct drm_mm_node *node;
202 node = drm_mm_kmalloc(hole_node->mm, atomic);
203 if (unlikely(node == NULL))
206 drm_mm_insert_helper(hole_node, node, size, alignment, color);
208 return node;
212 * Search for free space and insert a preallocated memory node. Returns
213 * -ENOSPC if no suitable free area is available. The preallocated memory node
216 int drm_mm_insert_node_generic(struct drm_mm *mm, struct drm_mm_node *node,
227 drm_mm_insert_helper(hole_node, node, size, alignment, color);
231 int drm_mm_insert_node(struct drm_mm *mm, struct drm_mm_node *node,
234 return drm_mm_insert_node_generic(mm, node, size, alignment, 0);
238 struct drm_mm_node *node,
249 BUG_ON(!hole_node->hole_follows || node->allocated);
270 node->start = adj_start;
271 node->size = size;
272 node->mm = mm;
273 node->color = color;
274 node->allocated = 1;
276 INIT_LIST_HEAD(&node->hole_stack);
277 list_add(&node->node_list, &hole_node->node_list, (caddr_t)node);
279 BUG_ON(node->start + node->size > adj_end);
280 BUG_ON(node->start + node->size > end);
282 node->hole_follows = 0;
283 if (__drm_mm_hole_node_start(node) < hole_end) {
284 list_add(&node->hole_stack, &mm->hole_stack, (caddr_t)node);
285 node->hole_follows = 1;
297 struct drm_mm_node *node;
299 node = drm_mm_kmalloc(hole_node->mm, atomic);
300 if (unlikely(node == NULL))
303 drm_mm_insert_helper_range(hole_node, node, size, alignment, color,
306 return node;
310 * Search for free space and insert a preallocated memory node. Returns
312 * restricted allocations. The preallocated memory node must be cleared.
314 int drm_mm_insert_node_in_range_generic(struct drm_mm *mm, struct drm_mm_node *node,
326 drm_mm_insert_helper_range(hole_node, node,
332 int drm_mm_insert_node_in_range(struct drm_mm *mm, struct drm_mm_node *node,
336 return drm_mm_insert_node_in_range_generic(mm, node, size, alignment, 0, start, end);
340 * Remove a memory node from the allocator.
342 void drm_mm_remove_node(struct drm_mm_node *node)
344 struct drm_mm *mm = node->mm;
347 BUG_ON(node->scanned_block || node->scanned_prev_free
348 || node->scanned_next_free);
351 list_entry(node->node_list.prev, struct drm_mm_node, node_list);
353 if (node->hole_follows) {
354 BUG_ON(__drm_mm_hole_node_start(node) ==
355 __drm_mm_hole_node_end(node));
356 list_del(&node->hole_stack);
359 BUG_ON(__drm_mm_hole_node_start(node) !=
360 __drm_mm_hole_node_end(node));
369 list_del(&node->node_list);
370 node->allocated = 0;
374 * Remove a memory node from the allocator and free the allocated struct
378 void drm_mm_put_block(struct drm_mm_node *node)
381 struct drm_mm *mm = node->mm;
383 drm_mm_remove_node(node);
387 list_add(&node->node_list, &mm->unused_nodes, (caddr_t)node);
390 kfree(node, sizeof(struct drm_mm_node));
564 * Add a node to the scan list that might be freed to make space for the desired
569 int drm_mm_scan_add_block(struct drm_mm_node *node)
571 struct drm_mm *mm = node->mm;
578 BUG_ON(node->scanned_block);
579 node->scanned_block = 1;
581 prev_node = list_entry(node->node_list.prev, struct drm_mm_node,
584 node->scanned_preceeds_hole = prev_node->hole_follows;
586 list_del(&node->node_list);
587 node->node_list.prev = &prev_node->node_list;
588 node->node_list.next = &mm->prev_scanned_node->node_list;
589 mm->prev_scanned_node = node;
616 * Remove a node from the scan list.
629 int drm_mm_scan_remove_block(struct drm_mm_node *node)
631 struct drm_mm *mm = node->mm;
636 BUG_ON(!node->scanned_block);
637 node->scanned_block = 0;
639 prev_node = list_entry(node->node_list.prev, struct drm_mm_node,
642 prev_node->hole_follows = node->scanned_preceeds_hole;
643 list_add(&node->node_list, &prev_node->node_list, (caddr_t)node);
645 return (drm_mm_hole_node_end(node) > mm->scan_hit_start &&
646 node->start < mm->scan_hit_end);
758 struct drm_mm_node *node;
759 node = list_entry(hole_node->node_list.next,
761 return node->start;