diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2006-01-23 10:05:22 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2006-01-23 10:05:22 +0000 |
commit | 270cffbe43955033a54dd54695ca1108194e087e (patch) | |
tree | 6ce3831ee973a740710266767249e8281717df0a /shared-core/i915_mem.c | |
parent | 9a01593f1aeda40abc5815b70fff9f909702501c (diff) |
Fix CMDBUFFER path, add heap destroy and flesh out sarea for rotation
(Tungsten Graphics)
Diffstat (limited to 'shared-core/i915_mem.c')
-rw-r--r-- | shared-core/i915_mem.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/shared-core/i915_mem.c b/shared-core/i915_mem.c index ba87ff17..13f19f3a 100644 --- a/shared-core/i915_mem.c +++ b/shared-core/i915_mem.c @@ -365,3 +365,33 @@ 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; +} |