aboutsummaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-07-07 18:37:37 +1000
committerDave Airlie <airlied@redhat.com>2010-07-07 18:37:37 +1000
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 4c10be39a43..bf01531193d 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -42,21 +42,31 @@
#endif
struct drm_mm_node {
- struct list_head fl_entry;
- struct list_head ml_entry;
- int free;
+ struct list_head free_stack;
+ struct list_head node_list;
+ unsigned free : 1;
+ unsigned scanned_block : 1;
+ unsigned scanned_prev_free : 1;
+ unsigned scanned_next_free : 1;
unsigned long start;
unsigned long size;
struct drm_mm *mm;
- void *private;
};
struct drm_mm {
- struct list_head fl_entry;
- struct list_head ml_entry;
+ /* List of free memory blocks, most recently freed ordered. */
+ struct list_head free_stack;
+ /* List of all memory nodes, ordered according to the (increasing) start
+ * address of the memory node. */
+ struct list_head node_list;
struct list_head unused_nodes;
int num_unused;
spinlock_t unused_lock;
+ unsigned scan_alignment;
+ unsigned long scan_size;
+ unsigned long scan_hit_start;
+ unsigned scan_hit_size;
+ unsigned scanned_blocks;
};
/*
@@ -133,6 +143,11 @@ static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block)
return block->mm;
}
+void drm_mm_init_scan(struct drm_mm *mm, unsigned long size,
+ unsigned alignment);
+int drm_mm_scan_add_block(struct drm_mm_node *node);
+int drm_mm_scan_remove_block(struct drm_mm_node *node);
+
extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix);
#ifdef CONFIG_DEBUG_FS
int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm);