summaryrefslogtreecommitdiff
path: root/shared/i915_mem.c
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@yahoo.com>2004-09-27 20:14:31 +0000
committerJon Smirl <jonsmirl@yahoo.com>2004-09-27 20:14:31 +0000
commit9e421181ddfc2d91859e9959487baf2df851e743 (patch)
tree6eaa1acc2f8d67365945b35b30bc060df436bd38 /shared/i915_mem.c
parent6d6526fdf9a4390fab3edbca79d6a0b80b84ddd1 (diff)
Fix the shared directory I accidentally stomped on
Diffstat (limited to 'shared/i915_mem.c')
-rw-r--r--shared/i915_mem.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/shared/i915_mem.c b/shared/i915_mem.c
index d54a3005..c6115b7e 100644
--- a/shared/i915_mem.c
+++ b/shared/i915_mem.c
@@ -7,6 +7,7 @@
*
**************************************************************************/
+#include "i915.h"
#include "drmP.h"
#include "drm.h"
#include "i915_drm.h"
@@ -74,7 +75,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;
@@ -90,7 +91,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;
@@ -147,7 +148,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) {
@@ -155,7 +156,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);
}
}
@@ -163,14 +164,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;
}
@@ -210,7 +211,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);
}
}
}
@@ -227,10 +228,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;
}