diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-06 10:43:13 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-06 10:43:13 -0200 |
commit | b2faf597d93bdf5e2d12d93ea0815935a73f749e (patch) | |
tree | 1876616290ff282b8a0814e2429d23e0104f3701 /drivers/char/drm/i915_mem.c | |
parent | 638e174688f58200d0deb7435093435e7d737b09 (diff) | |
parent | 410c05427a69f53851637ccb85c2212131409fbd (diff) |
Merge branch 'origin'
Diffstat (limited to 'drivers/char/drm/i915_mem.c')
-rw-r--r-- | drivers/char/drm/i915_mem.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/char/drm/i915_mem.c b/drivers/char/drm/i915_mem.c index ba87ff17ff6..52c67324df5 100644 --- a/drivers/char/drm/i915_mem.c +++ b/drivers/char/drm/i915_mem.c @@ -365,3 +365,34 @@ int i915_mem_init_heap(DRM_IOCTL_ARGS) return init_heap(heap, initheap.start, initheap.size); } + +int i915_mem_destroy_heap( DRM_IOCTL_ARGS ) +{ + DRM_DEVICE; + drm_i915_private_t *dev_priv = dev->dev_private; + drm_i915_mem_destroy_heap_t destroyheap; + struct mem_block **heap; + + if ( !dev_priv ) { + DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + return DRM_ERR(EINVAL); + } + + DRM_COPY_FROM_USER_IOCTL( destroyheap, (drm_i915_mem_destroy_heap_t *)data, + sizeof(destroyheap) ); + + heap = get_heap( dev_priv, destroyheap.region ); + if (!heap) { + DRM_ERROR("get_heap failed"); + return DRM_ERR(EFAULT); + } + + if (!*heap) { + DRM_ERROR("heap not initialized?"); + return DRM_ERR(EFAULT); + } + + i915_mem_takedown( heap ); + return 0; +} + |