aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-07-07 04:37:37 -0400
committerDave Airlie <airlied@redhat.com>2010-07-07 04:37:37 -0400
commita907a2e7d287f2b89fd81bc8edf164c0008c624f (patch)
treed93fecbe492cb9f65e6253d10a2f55333b8800de /include/drm
parentdb8cc27b804f89e8fd5f9d5385161956a777c471 (diff)
parent709ea97145c125b3811ff70429e90ebdb0e832e5 (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.h27
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
44struct drm_mm_node { 44struct 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
54struct drm_mm { 56struct 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
146void drm_mm_init_scan(struct drm_mm *mm, unsigned long size,
147 unsigned alignment);
148int drm_mm_scan_add_block(struct drm_mm_node *node);
149int drm_mm_scan_remove_block(struct drm_mm_node *node);
150
136extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); 151extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix);
137#ifdef CONFIG_DEBUG_FS 152#ifdef CONFIG_DEBUG_FS
138int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm); 153int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm);