From 89579f778266d5a4d08d0c64c46b1565218de9f9 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 17 Jun 2009 12:29:56 +0200 Subject: drm: Apply "Memory fragmentation from lost alignment blocks" also for the atomic path by using a common code-path. Signed-off-by: Thomas Hellstrom Signed-off-by: Dave Airlie --- include/drm/drm_mm.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'include/drm') diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 5662f4278ef3..f8332073d277 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h @@ -59,13 +59,22 @@ struct drm_mm { /* * Basic range manager support (drm_mm.c) */ - -extern struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent, - unsigned long size, - unsigned alignment); -extern struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *parent, +extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, + unsigned long size, + unsigned alignment, + int atomic); +static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent, unsigned long size, - unsigned alignment); + unsigned alignment) +{ + return drm_mm_get_block_generic(parent, size, alignment, 0); +} +static inline struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *parent, + unsigned long size, + unsigned alignment) +{ + return drm_mm_get_block_generic(parent, size, alignment, 1); +} extern void drm_mm_put_block(struct drm_mm_node *cur); extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, unsigned long size, -- cgit v1.2.3