diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-02-18 11:59:15 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-02-22 19:32:57 -0500 |
commit | ae0cec2880a4dc6d90c7f8392bdc6705988389ca (patch) | |
tree | 02a36c6ff5eb3e9f0554d9b5134ab374929c61fb /include/drm | |
parent | b0b7af1884b7d807a3504804f9825d472de78708 (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 'include/drm')
-rw-r--r-- | include/drm/drm_mm.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 17a070e11d3c..b1e7809e5e15 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
@@ -72,6 +72,7 @@ struct drm_mm { | |||
72 | unsigned scanned_blocks; | 72 | unsigned scanned_blocks; |
73 | unsigned long scan_start; | 73 | unsigned long scan_start; |
74 | unsigned long scan_end; | 74 | unsigned long scan_end; |
75 | struct drm_mm_node *prev_scanned_node; | ||
75 | }; | 76 | }; |
76 | 77 | ||
77 | static inline bool drm_mm_node_allocated(struct drm_mm_node *node) | 78 | static inline bool drm_mm_node_allocated(struct drm_mm_node *node) |
@@ -86,6 +87,13 @@ static inline bool drm_mm_initialized(struct drm_mm *mm) | |||
86 | #define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ | 87 | #define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ |
87 | &(mm)->head_node.node_list, \ | 88 | &(mm)->head_node.node_list, \ |
88 | node_list); | 89 | node_list); |
90 | #define drm_mm_for_each_scanned_node_reverse(entry, n, mm) \ | ||
91 | for (entry = (mm)->prev_scanned_node, \ | ||
92 | next = entry ? list_entry(entry->node_list.next, \ | ||
93 | struct drm_mm_node, node_list) : NULL; \ | ||
94 | entry != NULL; entry = next, \ | ||
95 | next = entry ? list_entry(entry->node_list.next, \ | ||
96 | struct drm_mm_node, node_list) : NULL) \ | ||
89 | /* | 97 | /* |
90 | * Basic range manager support (drm_mm.c) | 98 | * Basic range manager support (drm_mm.c) |
91 | */ | 99 | */ |