aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-02-18 11:59:15 -0500
committerDave Airlie <airlied@redhat.com>2011-02-22 19:32:57 -0500
commitae0cec2880a4dc6d90c7f8392bdc6705988389ca (patch)
tree02a36c6ff5eb3e9f0554d9b5134ab374929c61fb /drivers
parentb0b7af1884b7d807a3504804f9825d472de78708 (diff)
drm: mm: add helper to unwind scan state
With the switch to implicit free space accounting one pointer got unused when scanning. Use it to create a single-linked list to ensure correct unwinding of the scan state. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_mm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index d6432f9e49c1..add1737dae0d 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -460,6 +460,7 @@ void drm_mm_init_scan(struct drm_mm *mm, unsigned long size,
460 mm->scan_hit_start = 0; 460 mm->scan_hit_start = 0;
461 mm->scan_hit_size = 0; 461 mm->scan_hit_size = 0;
462 mm->scan_check_range = 0; 462 mm->scan_check_range = 0;
463 mm->prev_scanned_node = NULL;
463} 464}
464EXPORT_SYMBOL(drm_mm_init_scan); 465EXPORT_SYMBOL(drm_mm_init_scan);
465 466
@@ -485,6 +486,7 @@ void drm_mm_init_scan_with_range(struct drm_mm *mm, unsigned long size,
485 mm->scan_start = start; 486 mm->scan_start = start;
486 mm->scan_end = end; 487 mm->scan_end = end;
487 mm->scan_check_range = 1; 488 mm->scan_check_range = 1;
489 mm->prev_scanned_node = NULL;
488} 490}
489EXPORT_SYMBOL(drm_mm_init_scan_with_range); 491EXPORT_SYMBOL(drm_mm_init_scan_with_range);
490 492
@@ -514,6 +516,8 @@ int drm_mm_scan_add_block(struct drm_mm_node *node)
514 prev_node->hole_follows = 1; 516 prev_node->hole_follows = 1;
515 list_del(&node->node_list); 517 list_del(&node->node_list);
516 node->node_list.prev = &prev_node->node_list; 518 node->node_list.prev = &prev_node->node_list;
519 node->node_list.next = &mm->prev_scanned_node->node_list;
520 mm->prev_scanned_node = node;
517 521
518 hole_start = drm_mm_hole_node_start(prev_node); 522 hole_start = drm_mm_hole_node_start(prev_node);
519 hole_end = drm_mm_hole_node_end(prev_node); 523 hole_end = drm_mm_hole_node_end(prev_node);