writer->sba_offset = 0;
if (writer->items) {
- icd_free(writer->items);
+ intel_free(cmd, writer->items);
writer->items = NULL;
writer->item_alloc = 0;
writer->item_used = 0;
writer->item_alloc << 1 : 256;
struct intel_cmd_item *items;
- items = icd_alloc(sizeof(writer->items[0]) * new_alloc,
+ items = intel_alloc(cmd, sizeof(writer->items[0]) * new_alloc,
0, XGL_SYSTEM_ALLOC_DEBUG);
if (!items) {
writer->item_used = 0;
memcpy(items, writer->items,
sizeof(writer->items[0]) * writer->item_alloc);
- icd_free(writer->items);
+ intel_free(cmd, writer->items);
writer->items = items;
writer->item_alloc = new_alloc;
cmd_writer_reset(cmd, i);
if (cmd->bind.shader_cache.entries)
- icd_free(cmd->bind.shader_cache.entries);
+ intel_free(cmd, cmd->bind.shader_cache.entries);
if (cmd->bind.dset.graphics_dynamic_offsets)
- icd_free(cmd->bind.dset.graphics_dynamic_offsets);
+ intel_free(cmd, cmd->bind.dset.graphics_dynamic_offsets);
if (cmd->bind.dset.compute_dynamic_offsets)
- icd_free(cmd->bind.dset.compute_dynamic_offsets);
+ intel_free(cmd, cmd->bind.dset.compute_dynamic_offsets);
memset(&cmd->bind, 0, sizeof(cmd->bind));
* and end offsets, for each referenced memories.
*/
cmd->reloc_count = dev->gpu->batch_buffer_reloc_count;
- cmd->relocs = icd_alloc(sizeof(cmd->relocs[0]) * cmd->reloc_count,
+ cmd->relocs = intel_alloc(cmd, sizeof(cmd->relocs[0]) * cmd->reloc_count,
4096, XGL_SYSTEM_ALLOC_INTERNAL);
if (!cmd->relocs) {
intel_cmd_destroy(cmd);
{
cmd_reset(cmd);
- icd_free(cmd->relocs);
+ intel_free(cmd, cmd->relocs);
intel_base_destroy(&cmd->obj.base);
}
const uint32_t count = cache->count + 16;
void *entries;
- entries = icd_alloc(sizeof(cache->entries[0]) * count, 0,
+ entries = intel_alloc(cmd, sizeof(cache->entries[0]) * count, 0,
XGL_SYSTEM_ALLOC_INTERNAL);
if (entries) {
if (cache->entries) {
memcpy(entries, cache->entries,
sizeof(cache->entries[0]) * cache->used);
- icd_free(cache->entries);
+ intel_free(cmd, cache->entries);
}
cache->entries = entries;
if (size > cmd->bind.dset.graphics_dynamic_offset_size) {
if (cmd->bind.dset.graphics_dynamic_offsets)
- icd_free(cmd->bind.dset.graphics_dynamic_offsets);
+ intel_free(cmd, cmd->bind.dset.graphics_dynamic_offsets);
- cmd->bind.dset.graphics_dynamic_offsets = icd_alloc(size,
- 4, XGL_SYSTEM_ALLOC_INTERNAL);
+ cmd->bind.dset.graphics_dynamic_offsets = intel_alloc(cmd,
+ size, 4, XGL_SYSTEM_ALLOC_INTERNAL);
if (!cmd->bind.dset.graphics_dynamic_offsets) {
cmd_fail(cmd, XGL_ERROR_OUT_OF_MEMORY);
return;
if (size > cmd->bind.dset.compute_dynamic_offset_size) {
if (cmd->bind.dset.compute_dynamic_offsets)
- icd_free(cmd->bind.dset.compute_dynamic_offsets);
+ intel_free(cmd, cmd->bind.dset.compute_dynamic_offsets);
- cmd->bind.dset.compute_dynamic_offsets = icd_alloc(size,
- 4, XGL_SYSTEM_ALLOC_INTERNAL);
+ cmd->bind.dset.compute_dynamic_offsets = intel_alloc(cmd,
+ size, 4, XGL_SYSTEM_ALLOC_INTERNAL);
if (!cmd->bind.dset.compute_dynamic_offsets) {
cmd_fail(cmd, XGL_ERROR_OUT_OF_MEMORY);
return;
uint32_t surface_count, i;
rmap = (struct intel_pipeline_rmap *)
- icd_alloc(sizeof(*rmap), 0, XGL_SYSTEM_ALLOC_INTERNAL);
+ intel_alloc(gpu, sizeof(*rmap), 0, XGL_SYSTEM_ALLOC_INTERNAL);
if (!rmap)
return NULL;
rmap->slot_count = surface_count + rmap->sampler_count;
rmap->slots = (struct intel_pipeline_rmap_slot *)
- icd_alloc(sizeof(rmap->slots[0]) * rmap->slot_count,
+ intel_alloc(gpu, sizeof(rmap->slots[0]) * rmap->slot_count,
0, XGL_SYSTEM_ALLOC_INTERNAL);
if (!rmap->slots) {
- icd_free(rmap);
+ intel_free(gpu, rmap);
return NULL;
}
{
pipe_shader->codeSize = get_vs_program_size(brw->shader_prog);
- pipe_shader->pCode = icd_alloc(pipe_shader->codeSize, 0, XGL_SYSTEM_ALLOC_INTERNAL_SHADER);
+ pipe_shader->pCode = intel_alloc(gpu, pipe_shader->codeSize, 0, XGL_SYSTEM_ALLOC_INTERNAL_SHADER);
if (!pipe_shader->pCode) {
status = XGL_ERROR_OUT_OF_MEMORY;
break;
pipe_shader->codeSize = get_wm_program_size(brw->shader_prog);
- pipe_shader->pCode = icd_alloc(pipe_shader->codeSize, 0, XGL_SYSTEM_ALLOC_INTERNAL_SHADER);
+ pipe_shader->pCode = intel_alloc(gpu, pipe_shader->codeSize, 0, XGL_SYSTEM_ALLOC_INTERNAL_SHADER);
if (!pipe_shader->pCode) {
status = XGL_ERROR_OUT_OF_MEMORY;
break;
const uint32_t sampler_count = 16384;
struct intel_desc_pool *pool;
- pool = icd_alloc(sizeof(*pool), 0, XGL_SYSTEM_ALLOC_INTERNAL);
+ pool = intel_alloc(dev, sizeof(*pool), 0, XGL_SYSTEM_ALLOC_INTERNAL);
if (!pool)
return XGL_ERROR_OUT_OF_MEMORY;
memset(pool, 0, sizeof(*pool));
if (!desc_pool_init_desc_sizes(pool, dev->gpu)) {
- icd_free(pool);
+ intel_free(dev, pool);
return XGL_ERROR_UNKNOWN;
}
pool->surface_desc_size * surface_count,
pool->sampler_desc_size * sampler_count);
- pool->surfaces = icd_alloc(pool->size.surface,
+ pool->surfaces = intel_alloc(dev, pool->size.surface,
64, XGL_SYSTEM_ALLOC_INTERNAL);
if (!pool->surfaces) {
- icd_free(pool);
+ intel_free(dev, pool);
return XGL_ERROR_OUT_OF_MEMORY;
}
- pool->samplers = icd_alloc(pool->size.sampler,
+ pool->samplers = intel_alloc(dev, pool->size.sampler,
64, XGL_SYSTEM_ALLOC_INTERNAL);
if (!pool->samplers) {
- icd_free(pool->surfaces);
- icd_free(pool);
+ intel_free(dev, pool->surfaces);
+ intel_free(dev, pool);
return XGL_ERROR_OUT_OF_MEMORY;
}
info = info->pNext;
}
- layout->ranges = icd_alloc(sizeof(layout->ranges[0]) *
+ layout->ranges = intel_alloc(layout, sizeof(layout->ranges[0]) *
layout->range_count, 0, XGL_SYSTEM_ALLOC_INTERNAL);
if (!layout->ranges)
return XGL_ERROR_OUT_OF_MEMORY;
void intel_desc_layout_destroy(struct intel_desc_layout *layout)
{
- icd_free(layout->ranges);
+ intel_free(layout, layout->ranges);
intel_base_destroy(&layout->obj.base);
}
filter = dbg->filters;
while (filter) {
struct intel_dev_dbg_msg_filter *next = filter->next;
- icd_free(filter);
+ intel_free(dev, filter);
filter = next;
}
f->triggered = false;
}
} else {
- f = icd_alloc(sizeof(*f), 0, XGL_SYSTEM_ALLOC_DEBUG);
+ f = intel_alloc(dev, sizeof(*f), 0, XGL_SYSTEM_ALLOC_DEBUG);
if (!f)
return XGL_ERROR_OUT_OF_MEMORY;
else
dbg->filters = f->next;
- icd_free(f);
+ intel_free(dev, f);
break;
}
intel_wsi_x11_destroy(gpu->x11);
#endif
- icd_free(gpu->primary_node);
- icd_free(gpu);
+ intel_free(gpu, gpu->primary_node);
+ intel_free(gpu, gpu);
}
static int devid_to_gen(int devid)
return XGL_ERROR_INITIALIZATION_FAILED;
}
- gpu = icd_alloc(sizeof(*gpu), 0, XGL_SYSTEM_ALLOC_API_OBJECT);
+ gpu = intel_alloc(instance, sizeof(*gpu), 0, XGL_SYSTEM_ALLOC_API_OBJECT);
if (!gpu)
return XGL_ERROR_OUT_OF_MEMORY;
primary_len = strlen(primary_node);
render_len = (render_node) ? strlen(render_node) : 0;
- gpu->primary_node = icd_alloc(primary_len + 1 +
+ gpu->primary_node = intel_alloc(gpu, primary_len + 1 +
((render_len) ? (render_len + 1) : 0), 0, XGL_SYSTEM_ALLOC_INTERNAL);
if (!gpu->primary_node) {
- icd_free(gpu);
+ intel_free(instance, gpu);
return XGL_ERROR_OUT_OF_MEMORY;
}
if (layout->separate_stencil) {
XGL_IMAGE_CREATE_INFO s8_info;
- img->s8_layout = icd_alloc(sizeof(*img->s8_layout), 0,
+ img->s8_layout = intel_alloc(img, sizeof(*img->s8_layout), 0,
XGL_SYSTEM_ALLOC_INTERNAL);
if (!img->s8_layout) {
intel_img_destroy(img);
#endif
if (img->s8_layout)
- icd_free(img->s8_layout);
+ intel_free(img, img->s8_layout);
intel_base_destroy(&img->obj.base);
}
assert(dbg_size >= sizeof(*dbg));
- dbg = icd_alloc(dbg_size, 0, XGL_SYSTEM_ALLOC_DEBUG);
+ dbg = intel_alloc(handle, dbg_size, 0, XGL_SYSTEM_ALLOC_DEBUG);
if (!dbg)
return NULL;
dbg->type = type;
if (!base_dbg_copy_create_info(dbg, create_info)) {
- icd_free(dbg);
+ intel_free(handle, dbg);
return NULL;
}
assert(obj_size >= sizeof(*base));
- base = icd_alloc(obj_size, 0, XGL_SYSTEM_ALLOC_API_OBJECT);
+ base = intel_alloc(handle, obj_size, 0, XGL_SYSTEM_ALLOC_API_OBJECT);
if (!base)
return NULL;
base->dbg = intel_base_dbg_create(handle,
type, create_info, dbg_size);
if (!base->dbg) {
- icd_free(base);
+ intel_free(handle, base);
return NULL;
}
}
{
if (base->dbg)
intel_base_dbg_destroy(base->dbg);
- icd_free(base);
+ intel_free(base, base);
}
ICD_EXPORT XGL_RESULT XGLAPI xglDestroyObject(
if (!dbg)
return XGL_SUCCESS;
- tag = icd_alloc(tagSize, 0, XGL_SYSTEM_ALLOC_DEBUG);
+ tag = intel_alloc(base, tagSize, 0, XGL_SYSTEM_ALLOC_DEBUG);
if (!tag)
return XGL_ERROR_OUT_OF_MEMORY;
memcpy(tag, pTag, tagSize);
if (dbg->tag)
- icd_free(dbg->tag);
+ intel_free(base, dbg->tag);
dbg->tag = tag;
dbg->tag_size = tagSize;
struct intel_pipeline_shader *sh;
XGL_RESULT ret;
- sh = icd_alloc(sizeof(*sh), 0, XGL_SYSTEM_ALLOC_INTERNAL);
+ sh = intel_alloc(dev, sizeof(*sh), 0, XGL_SYSTEM_ALLOC_INTERNAL);
if (!sh)
return NULL;
memset(sh, 0, sizeof(*sh));
ret = intel_pipeline_shader_compile_meta(sh, dev->gpu, id);
if (ret != XGL_SUCCESS) {
- icd_free(sh);
+ intel_free(dev, sh);
return NULL;
}
state->cmd_scissor_rect_pos = state->cmd_len;
state->cmd_len += 2 * info->viewportAndScissorCount;
- state->cmd = icd_alloc(sizeof(uint32_t) * state->cmd_len,
+ state->cmd = intel_alloc(state, sizeof(uint32_t) * state->cmd_len,
0, XGL_SYSTEM_ALLOC_INTERNAL);
if (!state->cmd)
return XGL_ERROR_OUT_OF_MEMORY;
void intel_viewport_state_destroy(struct intel_dynamic_vp *state)
{
- icd_free(state->cmd);
+ intel_free(state, state->cmd);
intel_base_destroy(&state->obj.base);
}