Lines Matching refs:hole
64 struct amdgpu_bo_va_hole *hole, *tmp; in amdgpu_vamgr_deinit() local
65 LIST_FOR_EACH_ENTRY_SAFE(hole, tmp, &mgr->va_holes, list) { in amdgpu_vamgr_deinit()
66 list_del(&hole->list); in amdgpu_vamgr_deinit()
67 free(hole); in amdgpu_vamgr_deinit()
76 struct amdgpu_bo_va_hole *hole, *n; in amdgpu_vamgr_find_va() local
87 LIST_FOR_EACH_ENTRY_SAFE_REV(hole, n, &mgr->va_holes, list) { in amdgpu_vamgr_find_va()
89 if (hole->offset > base_required || in amdgpu_vamgr_find_va()
90 (hole->offset + hole->size) < (base_required + size)) in amdgpu_vamgr_find_va()
92 waste = base_required - hole->offset; in amdgpu_vamgr_find_va()
95 offset = hole->offset; in amdgpu_vamgr_find_va()
99 if (offset >= (hole->offset + hole->size)) { in amdgpu_vamgr_find_va()
103 if (!waste && hole->size == size) { in amdgpu_vamgr_find_va()
104 offset = hole->offset; in amdgpu_vamgr_find_va()
105 list_del(&hole->list); in amdgpu_vamgr_find_va()
106 free(hole); in amdgpu_vamgr_find_va()
110 if ((hole->size - waste) > size) { in amdgpu_vamgr_find_va()
114 n->offset = hole->offset; in amdgpu_vamgr_find_va()
115 list_add(&n->list, &hole->list); in amdgpu_vamgr_find_va()
117 hole->size -= (size + waste); in amdgpu_vamgr_find_va()
118 hole->offset += size + waste; in amdgpu_vamgr_find_va()
122 if ((hole->size - waste) == size) { in amdgpu_vamgr_find_va()
123 hole->size = waste; in amdgpu_vamgr_find_va()
136 struct amdgpu_bo_va_hole *hole, *next; in amdgpu_vamgr_free_va() local
144 hole = container_of(&mgr->va_holes, hole, list); in amdgpu_vamgr_free_va()
148 hole = next; in amdgpu_vamgr_free_va()
151 if (&hole->list != &mgr->va_holes) { in amdgpu_vamgr_free_va()
153 if (hole->offset == (va + size)) { in amdgpu_vamgr_free_va()
154 hole->offset = va; in amdgpu_vamgr_free_va()
155 hole->size += size; in amdgpu_vamgr_free_va()
157 if (next != hole && in amdgpu_vamgr_free_va()
160 next->size += hole->size; in amdgpu_vamgr_free_va()
161 list_del(&hole->list); in amdgpu_vamgr_free_va()
162 free(hole); in amdgpu_vamgr_free_va()
169 if (next != hole && &next->list != &mgr->va_holes && in amdgpu_vamgr_free_va()
182 list_add(&next->list, &hole->list); in amdgpu_vamgr_free_va()