Lines Matching refs:hole
1040 remove_hole(struct radv_device *device, union radv_shader_arena_block *hole)
1042 unsigned size_class = get_size_class(hole->size, false);
1043 list_del(&hole->freelist);
1049 add_hole(struct radv_device *device, union radv_shader_arena_block *hole)
1051 unsigned size_class = get_size_class(hole->size, false);
1052 list_addtail(&hole->freelist, &device->shader_free_lists[size_class]);
1094 /* Try to use an existing hole. Unless the shader is very large, this should only have to look
1103 list_for_each_entry(union radv_shader_arena_block, hole,
1106 if (hole->size < size)
1109 assert(hole->offset % RADV_SHADER_ALLOC_ALIGNMENT == 0);
1111 if (size == hole->size) {
1112 remove_hole(device, hole);
1113 hole->freelist.next = ptr;
1115 return hole;
1122 list_addtail(&alloc->list, &hole->list);
1125 alloc->arena = hole->arena;
1126 alloc->offset = hole->offset;
1129 remove_hole(device, hole);
1130 hole->offset += size;
1131 hole->size -= size;
1132 add_hole(device, hole);
1142 union radv_shader_arena_block *alloc = NULL, *hole = NULL;
1163 hole = arena_size - size > 0 ? alloc_block_obj(device) : alloc;
1164 if (!alloc || !hole)
1173 if (hole != alloc) {
1174 hole->arena = arena;
1175 hole->offset = size;
1176 hole->size = arena_size - size;
1178 list_addtail(&hole->list, &arena->entries);
1179 add_hole(device, hole);
1190 free(hole);
1203 union radv_shader_arena_block *hole = LIST_ENTRY(union radv_shader_arena_block, head, list);
1204 return hole->freelist.prev ? hole : NULL;
1215 union radv_shader_arena_block *hole = alloc;
1217 /* merge with previous hole */
1221 hole_prev->size += hole->size;
1222 list_del(&hole->list);
1223 free_block_obj(device, hole);
1225 hole = hole_prev;
1228 /* merge with next hole */
1232 hole_next->offset -= hole->size;
1233 hole_next->size += hole->size;
1234 list_del(&hole->list);
1235 free_block_obj(device, hole);
1237 hole = hole_next;
1240 if (list_is_singular(&hole->list)) {
1241 struct radv_shader_arena *arena = hole->arena;
1242 free_block_obj(device, hole);
1248 add_hole(device, hole);