diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-02-02 21:51:52 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-02-02 21:51:52 -0500 |
commit | 33052057e3e2db7f37fc78aa3f25c98f7e989fae (patch) | |
tree | e80a3aa1371f513c833dc94a16674f78faeeeb1d /drivers/char/drm/i915_mem.c | |
parent | 00b464debf0038b1628996065f0be564ccfbfd86 (diff) | |
parent | 1113a7e92e483074c6235da59460759e33b9b144 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
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 ba87ff17ff64..52c67324df58 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) | |||
365 | 365 | ||
366 | return init_heap(heap, initheap.start, initheap.size); | 366 | return init_heap(heap, initheap.start, initheap.size); |
367 | } | 367 | } |
368 | |||
369 | int i915_mem_destroy_heap( DRM_IOCTL_ARGS ) | ||
370 | { | ||
371 | DRM_DEVICE; | ||
372 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
373 | drm_i915_mem_destroy_heap_t destroyheap; | ||
374 | struct mem_block **heap; | ||
375 | |||
376 | if ( !dev_priv ) { | ||
377 | DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); | ||
378 | return DRM_ERR(EINVAL); | ||
379 | } | ||
380 | |||
381 | DRM_COPY_FROM_USER_IOCTL( destroyheap, (drm_i915_mem_destroy_heap_t *)data, | ||
382 | sizeof(destroyheap) ); | ||
383 | |||
384 | heap = get_heap( dev_priv, destroyheap.region ); | ||
385 | if (!heap) { | ||
386 | DRM_ERROR("get_heap failed"); | ||
387 | return DRM_ERR(EFAULT); | ||
388 | } | ||
389 | |||
390 | if (!*heap) { | ||
391 | DRM_ERROR("heap not initialized?"); | ||
392 | return DRM_ERR(EFAULT); | ||
393 | } | ||
394 | |||
395 | i915_mem_takedown( heap ); | ||
396 | return 0; | ||
397 | } | ||
398 | |||