summaryrefslogtreecommitdiff
path: root/bsd-core/drm_drawable.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-11-13 15:30:06 -0800
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-11-13 15:30:06 -0800
commit965b4d662a5236ee5aeb94a70f62565b6ed5644c (patch)
tree7645e5130046e3952c2a490d5561bafe67cbff89 /bsd-core/drm_drawable.c
parent9a4cb7eab4f74747cc777a3fef31dbb46e1191e5 (diff)
parent7e27b3ba88f0c40680380636a436c18e3220c7ce (diff)
Merge branch 'master' into modesetting-gem
Conflicts: libdrm/Makefile.am libdrm/intel/intel_bufmgr.h libdrm/intel/intel_bufmgr_fake.c libdrm/intel/intel_bufmgr_gem.c shared-core/drm.h shared-core/i915_dma.c shared-core/i915_irq.c shared-core/radeon_cp.c shared-core/radeon_drv.h
Diffstat (limited to 'bsd-core/drm_drawable.c')
-rw-r--r--bsd-core/drm_drawable.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/bsd-core/drm_drawable.c b/bsd-core/drm_drawable.c
index 018db57d..2ae11dbb 100644
--- a/bsd-core/drm_drawable.c
+++ b/bsd-core/drm_drawable.c
@@ -71,8 +71,8 @@ int drm_adddraw(struct drm_device *dev, void *data, struct drm_file *file_priv)
struct drm_draw *draw = data;
struct bsd_drm_drawable_info *info;
- info = drm_calloc(1, sizeof(struct bsd_drm_drawable_info),
- DRM_MEM_DRAWABLE);
+ info = malloc(sizeof(struct bsd_drm_drawable_info), DRM_MEM_DRAWABLE,
+ M_NOWAIT | M_ZERO);
if (info == NULL)
return ENOMEM;
@@ -99,8 +99,8 @@ int drm_rmdraw(struct drm_device *dev, void *data, struct drm_file *file_priv)
(struct bsd_drm_drawable_info *)info);
DRM_SPINUNLOCK(&dev->drw_lock);
free_unr(dev->drw_unrhdr, draw->handle);
- drm_free(info, sizeof(struct bsd_drm_drawable_info),
- DRM_MEM_DRAWABLE);
+ free(info->rects, DRM_MEM_DRAWABLE);
+ free(info, DRM_MEM_DRAWABLE);
return 0;
} else {
DRM_SPINUNLOCK(&dev->drw_lock);
@@ -123,9 +123,7 @@ int drm_update_draw(struct drm_device *dev, void *data,
case DRM_DRAWABLE_CLIPRECTS:
DRM_SPINLOCK(&dev->drw_lock);
if (update->num != info->num_rects) {
- drm_free(info->rects,
- sizeof(*info->rects) * info->num_rects,
- DRM_MEM_DRAWABLE);
+ free(info->rects, DRM_MEM_DRAWABLE);
info->rects = NULL;
info->num_rects = 0;
}
@@ -134,8 +132,8 @@ int drm_update_draw(struct drm_device *dev, void *data,
return 0;
}
if (info->rects == NULL) {
- info->rects = drm_alloc(sizeof(*info->rects) *
- update->num, DRM_MEM_DRAWABLE);
+ info->rects = malloc(sizeof(*info->rects) *
+ update->num, DRM_MEM_DRAWABLE, M_NOWAIT);
if (info->rects == NULL) {
DRM_SPINUNLOCK(&dev->drw_lock);
return ENOMEM;
@@ -164,8 +162,8 @@ void drm_drawable_free_all(struct drm_device *dev)
(struct bsd_drm_drawable_info *)info);
DRM_SPINUNLOCK(&dev->drw_lock);
free_unr(dev->drw_unrhdr, info->handle);
- drm_free(info, sizeof(struct bsd_drm_drawable_info),
- DRM_MEM_DRAWABLE);
+ free(info->info.rects, DRM_MEM_DRAWABLE);
+ free(info, DRM_MEM_DRAWABLE);
DRM_SPINLOCK(&dev->drw_lock);
}
DRM_SPINUNLOCK(&dev->drw_lock);