summaryrefslogtreecommitdiff
path: root/linux-core/drm_mm.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-10-17 11:28:48 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-10-17 11:28:48 +0200
commitdb5c671e86c3db8c99ce5a4954632248e6f849aa (patch)
tree02f15f8b557db2f20bf5773fe4403d8e62b24d46 /linux-core/drm_mm.c
parent5881ce1b91034fbdf81dda37a23215cfc1310cdf (diff)
Remove the memory manager parameter from the put_block function, as this
makes the client code a lot cleaner. Prepare buffer manager for lock and unlock calls.
Diffstat (limited to 'linux-core/drm_mm.c')
-rw-r--r--linux-core/drm_mm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux-core/drm_mm.c b/linux-core/drm_mm.c
index debac9d9..ef8bd7e9 100644
--- a/linux-core/drm_mm.c
+++ b/linux-core/drm_mm.c
@@ -70,6 +70,7 @@ drm_mm_node_t *drm_mm_get_block(drm_mm_node_t * parent,
child->free = 0;
child->size = size;
child->start = parent->start;
+ child->mm = parent->mm;
list_add_tail(&child->ml_entry, &parent->ml_entry);
parent->size -= size;
@@ -83,9 +84,10 @@ drm_mm_node_t *drm_mm_get_block(drm_mm_node_t * parent,
* Otherwise add to the free stack.
*/
-void drm_mm_put_block(drm_mm_t * mm, drm_mm_node_t * cur)
+void drm_mm_put_block(drm_mm_node_t * cur)
{
+ drm_mm_t *mm = cur->mm;
drm_mm_node_t *list_root = &mm->root_node;
struct list_head *cur_head = &cur->ml_entry;
struct list_head *root_head = &list_root->ml_entry;
@@ -183,6 +185,7 @@ int drm_mm_init(drm_mm_t * mm, unsigned long start, unsigned long size)
child->start = start;
child->size = size;
child->free = 1;
+ child->mm = mm;
list_add(&child->fl_entry, &mm->root_node.fl_entry);
list_add(&child->ml_entry, &mm->root_node.ml_entry);