Lines Matching refs:hole
60 struct amdgpu_bo_va_hole *hole, *tmp;
61 LIST_FOR_EACH_ENTRY_SAFE(hole, tmp, &mgr->va_holes, list) {
62 list_del(&hole->list);
63 free(hole);
72 struct amdgpu_bo_va_hole *hole, *n;
83 /* first look for a hole */
84 LIST_FOR_EACH_ENTRY_SAFE(hole, n, &mgr->va_holes, list) {
86 if(hole->offset > base_required ||
87 (hole->offset + hole->size) < (base_required + size))
89 waste = base_required - hole->offset;
92 offset = hole->offset;
96 if (offset >= (hole->offset + hole->size)) {
100 if (!waste && hole->size == size) {
101 offset = hole->offset;
102 list_del(&hole->list);
103 free(hole);
107 if ((hole->size - waste) > size) {
111 n->offset = hole->offset;
112 list_add(&n->list, &hole->list);
114 hole->size -= (size + waste);
115 hole->offset += size + waste;
119 if ((hole->size - waste) == size) {
120 hole->size = waste;
160 struct amdgpu_bo_va_hole *hole;
170 /* Delete uppermost hole if it reaches the new top */
172 hole = container_of(mgr->va_holes.next, hole, list);
173 if ((hole->offset + hole->size) == va) {
174 mgr->va_offset = hole->offset;
175 list_del(&hole->list);
176 free(hole);
182 hole = container_of(&mgr->va_holes, hole, list);
186 hole = next;
189 if (&hole->list != &mgr->va_holes) {
190 /* Grow upper hole if it's adjacent */
191 if (hole->offset == (va + size)) {
192 hole->offset = va;
193 hole->size += size;
194 /* Merge lower hole if it's adjacent */
195 if (next != hole
198 next->size += hole->size;
199 list_del(&hole->list);
200 free(hole);
206 /* Grow lower hole if it's adjacent */
207 if (next != hole && &next->list != &mgr->va_holes &&
220 list_add(&next->list, &hole->list);