diff options
author | Dave Airlie <airlied@redhat.com> | 2010-07-07 04:37:37 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-07-07 04:37:37 -0400 |
commit | a907a2e7d287f2b89fd81bc8edf164c0008c624f (patch) | |
tree | d93fecbe492cb9f65e6253d10a2f55333b8800de /include/drm | |
parent | db8cc27b804f89e8fd5f9d5385161956a777c471 (diff) | |
parent | 709ea97145c125b3811ff70429e90ebdb0e832e5 (diff) |
Merge branch 'drm-intel-lru' into drm-testing
* drm-intel-lru:
drm: implement helper functions for scanning lru list
drm_mm: extract check_free_mm_node
drm: sane naming for drm_mm.c
drm: kill dead code in drm_mm.c
drm: kill drm_mm_node->private
drm: use list_for_each_entry in drm_mm.c
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_mm.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 4c10be39a43b..bf01531193d5 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
@@ -42,21 +42,31 @@ | |||
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | struct drm_mm_node { | 44 | struct drm_mm_node { |
45 | struct list_head fl_entry; | 45 | struct list_head free_stack; |
46 | struct list_head ml_entry; | 46 | struct list_head node_list; |
47 | int free; | 47 | unsigned free : 1; |
48 | unsigned scanned_block : 1; | ||
49 | unsigned scanned_prev_free : 1; | ||
50 | unsigned scanned_next_free : 1; | ||
48 | unsigned long start; | 51 | unsigned long start; |
49 | unsigned long size; | 52 | unsigned long size; |
50 | struct drm_mm *mm; | 53 | struct drm_mm *mm; |
51 | void *private; | ||
52 | }; | 54 | }; |
53 | 55 | ||
54 | struct drm_mm { | 56 | struct drm_mm { |
55 | struct list_head fl_entry; | 57 | /* List of free memory blocks, most recently freed ordered. */ |
56 | struct list_head ml_entry; | 58 | struct list_head free_stack; |
59 | /* List of all memory nodes, ordered according to the (increasing) start | ||
60 | * address of the memory node. */ | ||
61 | struct list_head node_list; | ||
57 | struct list_head unused_nodes; | 62 | struct list_head unused_nodes; |
58 | int num_unused; | 63 | int num_unused; |
59 | spinlock_t unused_lock; | 64 | spinlock_t unused_lock; |
65 | unsigned scan_alignment; | ||
66 | unsigned long scan_size; | ||
67 | unsigned long scan_hit_start; | ||
68 | unsigned scan_hit_size; | ||
69 | unsigned scanned_blocks; | ||
60 | }; | 70 | }; |
61 | 71 | ||
62 | /* | 72 | /* |
@@ -133,6 +143,11 @@ static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block) | |||
133 | return block->mm; | 143 | return block->mm; |
134 | } | 144 | } |
135 | 145 | ||
146 | void drm_mm_init_scan(struct drm_mm *mm, unsigned long size, | ||
147 | unsigned alignment); | ||
148 | int drm_mm_scan_add_block(struct drm_mm_node *node); | ||
149 | int drm_mm_scan_remove_block(struct drm_mm_node *node); | ||
150 | |||
136 | extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); | 151 | extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); |
137 | #ifdef CONFIG_DEBUG_FS | 152 | #ifdef CONFIG_DEBUG_FS |
138 | int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm); | 153 | int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm); |