Lines Matching defs:heap

136 static struct mem_block *alloc_block(struct mem_block *heap, int size,
142 for (p = heap->next; p != heap; p = p->next) {
151 static struct mem_block *find_block(struct mem_block *heap, int start)
155 for (p = heap->next; p != heap; p = p->next)
167 * 'heap' to stop it being subsumed.
186 /* Initialize. How to check for an uninitialized heap?
188 static int init_heap(struct mem_block **heap, int start, int size)
195 *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFLISTS);
196 if (!*heap) {
204 blocks->next = blocks->prev = *heap;
206 memset(*heap, 0, sizeof(**heap));
207 (*heap)->file_priv = (struct drm_file *) - 1;
208 (*heap)->next = (*heap)->prev = blocks;
215 struct mem_block *heap)
219 if (!heap || !heap->next)
222 for (p = heap->next; p != heap; p = p->next) {
230 * 'heap' to stop it being subsumed.
232 for (p = heap->next; p != heap; p = p->next) {
245 void i915_mem_takedown(struct mem_block **heap)
249 if (!*heap)
252 for (p = (*heap)->next; p != *heap;) {
258 drm_free(*heap, sizeof(**heap), DRM_MEM_BUFLISTS);
259 *heap = NULL;
279 struct mem_block *block, **heap;
286 heap = get_heap(dev_priv, alloc->region);
287 if (!heap || !*heap)
296 block = alloc_block(*heap, alloc->size, alloc->alignment, file_priv);
317 struct mem_block *block, **heap;
324 heap = get_heap(dev_priv, memfree->region);
325 if (!heap || !*heap)
328 block = find_block(*heap, memfree->region_offset);
345 struct mem_block **heap;
352 heap = get_heap(dev_priv, initheap->region);
353 if (!heap)
356 if (*heap) {
357 DRM_ERROR("heap already initialized?");
361 return init_heap(heap, initheap->start, initheap->size);
369 struct mem_block **heap;
376 heap = get_heap( dev_priv, destroyheap->region );
377 if (!heap) {
382 if (!*heap) {
383 DRM_ERROR("heap not initialized?");
387 i915_mem_takedown( heap );