u64 adj_start = hole_start;
u64 adj_end = hole_end;
- BUG_ON(node->allocated);
+ DRM_MM_BUG_ON(node->allocated);
if (mm->color_adjust)
mm->color_adjust(hole_node, color, &adj_start, &adj_end);
}
}
- BUG_ON(adj_start < hole_start);
- BUG_ON(adj_end > hole_end);
+ DRM_MM_BUG_ON(adj_start < hole_start);
+ DRM_MM_BUG_ON(adj_end > hole_end);
if (adj_start == hole_start) {
hole_node->hole_follows = 0;
drm_mm_interval_tree_add_node(hole_node, node);
- BUG_ON(node->start + node->size > adj_end);
+ DRM_MM_BUG_ON(node->start + node->size > adj_end);
node->hole_follows = 0;
if (__drm_mm_hole_node_start(node) < hole_end) {
u64 adj_start = hole_start;
u64 adj_end = hole_end;
- BUG_ON(!hole_node->hole_follows || node->allocated);
+ DRM_MM_BUG_ON(!hole_node->hole_follows || node->allocated);
if (adj_start < start)
adj_start = start;
drm_mm_interval_tree_add_node(hole_node, node);
- BUG_ON(node->start < start);
- BUG_ON(node->start < adj_start);
- BUG_ON(node->start + node->size > adj_end);
- BUG_ON(node->start + node->size > end);
+ DRM_MM_BUG_ON(node->start < start);
+ DRM_MM_BUG_ON(node->start < adj_start);
+ DRM_MM_BUG_ON(node->start + node->size > adj_end);
+ DRM_MM_BUG_ON(node->start + node->size > end);
node->hole_follows = 0;
if (__drm_mm_hole_node_start(node) < hole_end) {
struct drm_mm *mm = node->mm;
struct drm_mm_node *prev_node;
- if (WARN_ON(!node->allocated))
- return;
-
- BUG_ON(node->scanned_block || node->scanned_prev_free
- || node->scanned_next_free);
+ DRM_MM_BUG_ON(!node->allocated);
+ DRM_MM_BUG_ON(node->scanned_block ||
+ node->scanned_prev_free ||
+ node->scanned_next_free);
prev_node =
list_entry(node->node_list.prev, struct drm_mm_node, node_list);
if (node->hole_follows) {
- BUG_ON(__drm_mm_hole_node_start(node) ==
- __drm_mm_hole_node_end(node));
+ DRM_MM_BUG_ON(__drm_mm_hole_node_start(node) ==
+ __drm_mm_hole_node_end(node));
list_del(&node->hole_stack);
} else
- BUG_ON(__drm_mm_hole_node_start(node) !=
- __drm_mm_hole_node_end(node));
+ DRM_MM_BUG_ON(__drm_mm_hole_node_start(node) !=
+ __drm_mm_hole_node_end(node));
if (!prev_node->hole_follows) {
u64 adj_end;
u64 best_size;
- BUG_ON(mm->scanned_blocks);
+ DRM_MM_BUG_ON(mm->scanned_blocks);
best = NULL;
best_size = ~0UL;
u64 adj_end;
u64 best_size;
- BUG_ON(mm->scanned_blocks);
+ DRM_MM_BUG_ON(mm->scanned_blocks);
best = NULL;
best_size = ~0UL;
*/
void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new)
{
+ DRM_MM_BUG_ON(!old->allocated);
+
list_replace(&old->node_list, &new->node_list);
list_replace(&old->hole_stack, &new->hole_stack);
rb_replace_node(&old->rb, &new->rb, &old->mm->interval_tree);
mm->scanned_blocks++;
- BUG_ON(node->scanned_block);
+ DRM_MM_BUG_ON(node->scanned_block);
node->scanned_block = 1;
prev_node = list_entry(node->node_list.prev, struct drm_mm_node,
mm->scanned_blocks--;
- BUG_ON(!node->scanned_block);
+ DRM_MM_BUG_ON(!node->scanned_block);
node->scanned_block = 0;
prev_node = list_entry(node->node_list.prev, struct drm_mm_node,