diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2006-01-25 15:31:43 +1100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-01-25 15:31:43 +1100 |
commit | de227f5f32775d86e5c780a7cffdd2e08574f7fb (patch) | |
tree | b1f866fdf54c42d4bc1370f6b529f81c1e4ccf24 /drivers/char/drm/i915_mem.c | |
parent | 507d256bae9eef7acd5049af6e3f67c24904a1e4 (diff) | |
download | linux-de227f5f32775d86e5c780a7cffdd2e08574f7fb.tar.gz linux-de227f5f32775d86e5c780a7cffdd2e08574f7fb.tar.bz2 linux-de227f5f32775d86e5c780a7cffdd2e08574f7fb.zip |
drm: i915 patches from Tungsten Graphics
Fix CMDBUFFER path, add heap destroy and flesh out sarea for rotation
(Tungsten Graphics)
From: Alan Hourihane <alanh@tungstengraphics.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
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) 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; +} + |