summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_irq.c
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2008-10-13 18:03:27 +0000
committerrnoland <rnoland@FreeBSD.org>2008-10-13 18:03:27 +0000
commit192b3600be5db1effa54d2e72717a7482aaeb52a (patch)
tree9afb72dec01dcbe8a080c5adf1bdbdde1abd41bd /sys/dev/drm/drm_irq.c
parent0d37976f3d86d7805a29299cc21e4b517b824aac (diff)
downloadFreeBSD-src-192b3600be5db1effa54d2e72717a7482aaeb52a.zip
FreeBSD-src-192b3600be5db1effa54d2e72717a7482aaeb52a.tar.gz
Rework memory allocation to allocate memory with different type names. This
will ease the identification of memory leaks as the OS will be able to track allocations for us by malloc type. vmstat -m will show all of the allocations. Convert the calls to drm_alloc() and friends, which are used in shared code to static __inline__ while we are here. Approved by: jhb (mentor)
Diffstat (limited to 'sys/dev/drm/drm_irq.c')
-rw-r--r--sys/dev/drm/drm_irq.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/drm/drm_irq.c b/sys/dev/drm/drm_irq.c
index 4fde981..534d501 100644
--- a/sys/dev/drm/drm_irq.c
+++ b/sys/dev/drm/drm_irq.c
@@ -114,8 +114,7 @@ static void drm_vblank_cleanup(struct drm_device *dev)
vblank_disable_fn((void *)dev);
- drm_free(dev->vblank, sizeof(struct drm_vblank_info) * dev->num_crtcs,
- DRM_MEM_DRIVER);
+ free(dev->vblank, DRM_MEM_DRIVER);
dev->num_crtcs = 0;
}
@@ -128,8 +127,8 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)
atomic_set(&dev->vbl_signal_pending, 0);
dev->num_crtcs = num_crtcs;
- dev->vblank = drm_calloc(num_crtcs, sizeof(struct drm_vblank_info),
- DRM_MEM_DRIVER);
+ dev->vblank = malloc(sizeof(struct drm_vblank_info) * num_crtcs,
+ DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
if (!dev->vblank)
goto err;
@@ -432,8 +431,8 @@ int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_pr
if (flags & _DRM_VBLANK_SIGNAL) {
#if 0 /* disabled */
- drm_vbl_sig_t *vbl_sig = malloc(sizeof(drm_vbl_sig_t), M_DRM,
- M_NOWAIT | M_ZERO);
+ drm_vbl_sig_t *vbl_sig = malloc(sizeof(drm_vbl_sig_t),
+ DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
if (vbl_sig == NULL)
return ENOMEM;
OpenPOWER on IntegriCloud