radeon_mem.c (119895) | radeon_mem.c (130331) |
---|---|
1/* radeon_mem.c -- Simple GART/fb memory manager for radeon -*- linux-c -*- 2 * 3 * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. 4 * 5 * The Weather Channel (TM) funded Tungsten Graphics to develop the 6 * initial release of the Radeon 8500 driver under the XFree86 license. 7 * This notice must be preserved. 8 * --- 17 unchanged lines hidden (view full) --- 26 * DEALINGS IN THE SOFTWARE. 27 * 28 * Authors: 29 * Keith Whitwell <keith@tungstengraphics.com> 30 * 31 */ 32 33#include <sys/cdefs.h> | 1/* radeon_mem.c -- Simple GART/fb memory manager for radeon -*- linux-c -*- 2 * 3 * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. 4 * 5 * The Weather Channel (TM) funded Tungsten Graphics to develop the 6 * initial release of the Radeon 8500 driver under the XFree86 license. 7 * This notice must be preserved. 8 * --- 17 unchanged lines hidden (view full) --- 26 * DEALINGS IN THE SOFTWARE. 27 * 28 * Authors: 29 * Keith Whitwell <keith@tungstengraphics.com> 30 * 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/dev/drm/radeon_mem.c 119895 2003-09-09 00:24:31Z anholt $"); | 34__FBSDID("$FreeBSD: head/sys/dev/drm/radeon_mem.c 130331 2004-06-11 03:26:59Z anholt $"); |
35 36#include "dev/drm/radeon.h" 37#include "dev/drm/drmP.h" 38#include "dev/drm/drm.h" 39#include "dev/drm/radeon_drm.h" 40#include "dev/drm/radeon_drv.h" 41 42/* Very simple allocator for GART memory, working on a static range --- 93 unchanged lines hidden (view full) --- 136 137/* Initialize. How to check for an uninitialized heap? 138 */ 139static int init_heap(struct mem_block **heap, int start, int size) 140{ 141 struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks)); 142 143 if (!blocks) | 35 36#include "dev/drm/radeon.h" 37#include "dev/drm/drmP.h" 38#include "dev/drm/drm.h" 39#include "dev/drm/radeon_drm.h" 40#include "dev/drm/radeon_drv.h" 41 42/* Very simple allocator for GART memory, working on a static range --- 93 unchanged lines hidden (view full) --- 136 137/* Initialize. How to check for an uninitialized heap? 138 */ 139static int init_heap(struct mem_block **heap, int start, int size) 140{ 141 struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks)); 142 143 if (!blocks) |
144 return -ENOMEM; | 144 return DRM_ERR(ENOMEM); |
145 146 *heap = DRM_MALLOC(sizeof(**heap)); 147 if (!*heap) { 148 DRM_FREE( blocks, sizeof(*blocks) ); | 145 146 *heap = DRM_MALLOC(sizeof(**heap)); 147 if (!*heap) { 148 DRM_FREE( blocks, sizeof(*blocks) ); |
149 return -ENOMEM; | 149 return DRM_ERR(ENOMEM); |
150 } 151 152 blocks->start = start; 153 blocks->size = size; 154 blocks->filp = 0; 155 blocks->next = blocks->prev = *heap; 156 157 memset( *heap, 0, sizeof(**heap) ); --- 170 unchanged lines hidden --- | 150 } 151 152 blocks->start = start; 153 blocks->size = size; 154 blocks->filp = 0; 155 blocks->next = blocks->prev = *heap; 156 157 memset( *heap, 0, sizeof(**heap) ); --- 170 unchanged lines hidden --- |