44 if (start > p->
start) {
54 p->
next->prev = newblock;
71 p->
next->prev = newblock;
83 int align2,
struct drm_file *file_priv)
86 int mask = (1 << align2) - 1;
91 return split_block(p, start, size, file_priv);
102 if (p->start == start)
115 if (p->next->file_priv == NULL) {
123 if (p->prev->file_priv == NULL) {
134 static int init_heap(
struct mem_block **heap,
int start,
int size)
150 blocks->
next = blocks->
prev = *heap;
152 (*heap)->
file_priv = (
struct drm_file *) - 1;
153 (*heap)->next = (*heap)->prev = blocks;
163 if (!heap || !heap->
next)
194 for (p = (*heap)->
next; p != *heap;) {
225 DRM_ERROR(
"called with no initialization\n");
229 heap = get_heap(dev_priv, alloc->
region);
239 block = alloc_block(*heap, alloc->
size, alloc->
alignment, file_priv);
246 DRM_ERROR(
"copy_to_user\n");
260 DRM_ERROR(
"called with no initialization\n");
264 heap = get_heap(dev_priv, memfree->
region);
286 DRM_ERROR(
"called with no initialization\n");
290 heap = get_heap(dev_priv, initheap->
region);
295 DRM_ERROR(
"heap already initialized?");
299 return init_heap(heap, initheap->
start, initheap->
size);