summaryrefslogtreecommitdiff
path: root/bsd-core/drm_dma.c
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2008-10-10 13:06:22 -0400
committerRobert Noland <rnoland@2hip.net>2008-10-10 13:06:22 -0400
commitcdd3e9fc562bd57e0272e4c4d1c0707776bd01a1 (patch)
tree97d7b554a5c040630fabcb693b7b26ab4ca5a9f1 /bsd-core/drm_dma.c
parent1150a42d4398b14c5db2f34a5beba613528df147 (diff)
[FreeBSD] Rework all of the memory allocations
Allocate memory from different pools. This allows the OS to track memory allocations for us, much like the linux memory debugging. This will ease tracking down memory leaks since the OS can track the number of allocations from each pool and help to point us in the right direction. Also replace drm_alloc and friends with static __inline__ versions while we are here.
Diffstat (limited to 'bsd-core/drm_dma.c')
-rw-r--r--bsd-core/drm_dma.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/bsd-core/drm_dma.c b/bsd-core/drm_dma.c
index 51f60683..c2d9994e 100644
--- a/bsd-core/drm_dma.c
+++ b/bsd-core/drm_dma.c
@@ -41,7 +41,7 @@
int drm_dma_setup(struct drm_device *dev)
{
- dev->dma = malloc(sizeof(*dev->dma), M_DRM, M_NOWAIT | M_ZERO);
+ dev->dma = malloc(sizeof(*dev->dma), DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
if (dev->dma == NULL)
return ENOMEM;
@@ -67,21 +67,21 @@ void drm_dma_takedown(struct drm_device *dev)
for (j = 0; j < dma->bufs[i].seg_count; j++) {
drm_pci_free(dev, dma->bufs[i].seglist[j]);
}
- free(dma->bufs[i].seglist, M_DRM);
+ free(dma->bufs[i].seglist, DRM_MEM_SEGS);
}
if (dma->bufs[i].buf_count) {
for (j = 0; j < dma->bufs[i].buf_count; j++) {
free(dma->bufs[i].buflist[j].dev_private,
- M_DRM);
+ DRM_MEM_BUFS);
}
- free(dma->bufs[i].buflist, M_DRM);
+ free(dma->bufs[i].buflist, DRM_MEM_BUFS);
}
}
- free(dma->buflist, M_DRM);
- free(dma->pagelist, M_DRM);
- free(dev->dma, M_DRM);
+ free(dma->buflist, DRM_MEM_BUFS);
+ free(dma->pagelist, DRM_MEM_PAGES);
+ free(dev->dma, DRM_MEM_DRIVER);
dev->dma = NULL;
DRM_SPINUNINIT(&dev->dma_lock);
}