summaryrefslogtreecommitdiff
path: root/shared-core/i915_mem.c
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@yahoo.com>2004-09-27 19:51:38 +0000
committerJon Smirl <jonsmirl@yahoo.com>2004-09-27 19:51:38 +0000
commitfa6b1d129e7bf8acf41e66c9c665ae9f9c1d5b0d (patch)
treec0b8605f134c4fe96a78f5b30644d25ac5ebcdf9 /shared-core/i915_mem.c
parent77fa7b9548bf7a5bf5e49515f1a478c27ede07a7 (diff)
First check in for DRM that splits core from personality modules
Diffstat (limited to 'shared-core/i915_mem.c')
-rw-r--r--shared-core/i915_mem.c21
1 files changed, 10 insertions, 11 deletions
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;
}