From fa6b1d129e7bf8acf41e66c9c665ae9f9c1d5b0d Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Mon, 27 Sep 2004 19:51:38 +0000 Subject: First check in for DRM that splits core from personality modules --- shared-core/i915_mem.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'shared-core/i915_mem.c') diff --git a/shared-core/i915_mem.c b/shared-core/i915_mem.c index c6115b7e..d54a3005 100644 --- a/shared-core/i915_mem.c +++ b/shared-core/i915_mem.c @@ -7,7 +7,6 @@ * **************************************************************************/ -#include "i915.h" #include "drmP.h" #include "drm.h" #include "i915_drm.h" @@ -75,7 +74,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, { /* Maybe cut off the start of an existing block */ if (start > p->start) { - struct mem_block *newblock = DRM(alloc)(sizeof(*newblock), DRM_MEM_BUFLISTS); + struct mem_block *newblock = drm_alloc(sizeof(*newblock), DRM_MEM_BUFLISTS); if (!newblock) goto out; newblock->start = start; @@ -91,7 +90,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size, /* Maybe cut off the end of an existing block */ if (size < p->size) { - struct mem_block *newblock = DRM(alloc)(sizeof(*newblock), DRM_MEM_BUFLISTS); + struct mem_block *newblock = drm_alloc(sizeof(*newblock), DRM_MEM_BUFLISTS); if (!newblock) goto out; newblock->start = start + size; @@ -148,7 +147,7 @@ static void free_block(struct mem_block *p) p->size += q->size; p->next = q->next; p->next->prev = p; - DRM(free)(q, sizeof(*q), DRM_MEM_BUFLISTS); + drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); } if (p->prev->filp == NULL) { @@ -156,7 +155,7 @@ static void free_block(struct mem_block *p) q->size += p->size; q->next = p->next; q->next->prev = q; - DRM(free)(p, sizeof(*q), DRM_MEM_BUFLISTS); + drm_free(p, sizeof(*q), DRM_MEM_BUFLISTS); } } @@ -164,14 +163,14 @@ static void free_block(struct mem_block *p) */ static int init_heap(struct mem_block **heap, int start, int size) { - struct mem_block *blocks = DRM(alloc)(sizeof(*blocks), DRM_MEM_BUFLISTS); + struct mem_block *blocks = drm_alloc(sizeof(*blocks), DRM_MEM_BUFLISTS); if (!blocks) return -ENOMEM; - *heap = DRM(alloc)(sizeof(**heap), DRM_MEM_BUFLISTS); + *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFLISTS); if (!*heap) { - DRM(free)(blocks, sizeof(*blocks), DRM_MEM_BUFLISTS); + drm_free(blocks, sizeof(*blocks), DRM_MEM_BUFLISTS); return -ENOMEM; } @@ -211,7 +210,7 @@ void i915_mem_release(drm_device_t * dev, DRMFILE filp, struct mem_block *heap) p->size += q->size; p->next = q->next; p->next->prev = p; - DRM(free)(q, sizeof(*q), DRM_MEM_BUFLISTS); + drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); } } } @@ -228,10 +227,10 @@ void i915_mem_takedown(struct mem_block **heap) for (p = (*heap)->next; p != *heap;) { struct mem_block *q = p; p = p->next; - DRM(free)(q, sizeof(*q), DRM_MEM_BUFLISTS); + drm_free(q, sizeof(*q), DRM_MEM_BUFLISTS); } - DRM(free)(*heap, sizeof(**heap), DRM_MEM_BUFLISTS); + drm_free(*heap, sizeof(**heap), DRM_MEM_BUFLISTS); *heap = NULL; } -- cgit v1.2.3