i915_mem.c (152909) | i915_mem.c (157617) |
---|---|
1/* i915_mem.c -- Simple agp/fb memory manager for i915 -*- linux-c -*- 2 */ 3/*- 4 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. 5 * All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 * 27 */ 28 29#include <sys/cdefs.h> | 1/* i915_mem.c -- Simple agp/fb memory manager for i915 -*- linux-c -*- 2 */ 3/*- 4 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. 5 * All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 * 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/drm/i915_mem.c 152909 2005-11-28 23:13:57Z anholt $"); | 30__FBSDID("$FreeBSD: head/sys/dev/drm/i915_mem.c 157617 2006-04-09 20:45:45Z anholt $"); |
31 32#include "dev/drm/drmP.h" 33#include "dev/drm/drm.h" 34#include "dev/drm/i915_drm.h" 35#include "dev/drm/i915_drv.h" 36 37/* This memory manager is integrated into the global/local lru 38 * mechanisms used by the clients. Specifically, it operates by --- 324 unchanged lines hidden (view full) --- 363 364 if (*heap) { 365 DRM_ERROR("heap already initialized?"); 366 return DRM_ERR(EFAULT); 367 } 368 369 return init_heap(heap, initheap.start, initheap.size); 370} | 31 32#include "dev/drm/drmP.h" 33#include "dev/drm/drm.h" 34#include "dev/drm/i915_drm.h" 35#include "dev/drm/i915_drv.h" 36 37/* This memory manager is integrated into the global/local lru 38 * mechanisms used by the clients. Specifically, it operates by --- 324 unchanged lines hidden (view full) --- 363 364 if (*heap) { 365 DRM_ERROR("heap already initialized?"); 366 return DRM_ERR(EFAULT); 367 } 368 369 return init_heap(heap, initheap.start, initheap.size); 370} |
371 372int i915_mem_destroy_heap( DRM_IOCTL_ARGS ) 373{ 374 DRM_DEVICE; 375 drm_i915_private_t *dev_priv = dev->dev_private; 376 drm_i915_mem_destroy_heap_t destroyheap; 377 struct mem_block **heap; 378 379 if ( !dev_priv ) { 380 DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); 381 return DRM_ERR(EINVAL); 382 } 383 384 DRM_COPY_FROM_USER_IOCTL( destroyheap, (drm_i915_mem_destroy_heap_t *)data, 385 sizeof(destroyheap) ); 386 387 heap = get_heap( dev_priv, destroyheap.region ); 388 if (!heap) { 389 DRM_ERROR("get_heap failed"); 390 return DRM_ERR(EFAULT); 391 } 392 393 if (!*heap) { 394 DRM_ERROR("heap not initialized?"); 395 return DRM_ERR(EFAULT); 396 } 397 398 i915_mem_takedown( heap ); 399 return 0; 400} |
|