diff options
author | Nian Wu <nian.wu@intel.com> | 2007-03-19 17:00:31 +0800 |
---|---|---|
committer | Nian Wu <nian.wu@intel.com> | 2007-03-19 17:00:31 +0800 |
commit | 8398b99d8d146278adc13d6093811e53cd42c88a (patch) | |
tree | 9da61388447defcfec68d7294989f6dc501d39ed /linux-core/drm_mm.c | |
parent | df73975980e926e350bf36bf4bc8a07220f66164 (diff) | |
parent | 1e77e52755c9bb94c9230778845e6701b4d82b3a (diff) |
Merge git://proxy01.pd.intel.com:9419/git/mesa/drm into crestline
Diffstat (limited to 'linux-core/drm_mm.c')
-rw-r--r-- | linux-core/drm_mm.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/linux-core/drm_mm.c b/linux-core/drm_mm.c index 634a1782..2caf596b 100644 --- a/linux-core/drm_mm.c +++ b/linux-core/drm_mm.c @@ -53,7 +53,7 @@ unsigned long drm_mm_tail_space(drm_mm_t *mm) entry = list_entry(tail_node, drm_mm_node_t, ml_entry); if (!entry->free) return 0; - + return entry->size; } @@ -66,7 +66,7 @@ int drm_mm_remove_space_from_tail(drm_mm_t *mm, unsigned long size) entry = list_entry(tail_node, drm_mm_node_t, ml_entry); if (!entry->free) return -ENOMEM; - + if (entry->size <= size) return -ENOMEM; @@ -80,7 +80,7 @@ static int drm_mm_create_tail_node(drm_mm_t *mm, unsigned long size) { drm_mm_node_t *child; - + child = (drm_mm_node_t *) drm_ctl_alloc(sizeof(*child), DRM_MEM_MM); if (!child) @@ -96,7 +96,7 @@ static int drm_mm_create_tail_node(drm_mm_t *mm, return 0; } - + int drm_mm_add_space_to_tail(drm_mm_t *mm, unsigned long size) { @@ -111,12 +111,12 @@ int drm_mm_add_space_to_tail(drm_mm_t *mm, unsigned long size) entry->size += size; return 0; } - + static drm_mm_node_t *drm_mm_split_at_start(drm_mm_node_t *parent, unsigned long size) { drm_mm_node_t *child; - + child = (drm_mm_node_t *) drm_ctl_alloc(sizeof(*child), DRM_MEM_MM); if (!child) @@ -136,8 +136,6 @@ static drm_mm_node_t *drm_mm_split_at_start(drm_mm_node_t *parent, parent->start += size; return child; } - - drm_mm_node_t *drm_mm_get_block(drm_mm_node_t * parent, unsigned long size, unsigned alignment) @@ -149,13 +147,13 @@ drm_mm_node_t *drm_mm_get_block(drm_mm_node_t * parent, if (alignment) tmp = parent->start % alignment; - + if (tmp) { align_splitoff = drm_mm_split_at_start(parent, alignment - tmp); if (!align_splitoff) return NULL; } - + if (parent->size == size) { list_del_init(&parent->fl_entry); parent->free = 0; |