u_upload_destroy(ice->state.surface_uploader);
u_upload_destroy(ice->state.dynamic_uploader);
+ slab_destroy_child(&ice->transfer_pool);
+
iris_batch_free(&ice->render_batch);
ralloc_free(ice);
iris_init_program_cache(ice);
iris_init_border_color_pool(ice);
+ slab_create_child(&ice->transfer_pool, &screen->transfer_pool);
+
ice->state.surface_uploader =
u_upload_create(&ice->ctx, 16384, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
IRIS_RESOURCE_FLAG_SURFACE_MEMZONE);
return false;
}
-struct iris_transfer {
- struct pipe_transfer base;
- struct pipe_debug_callback *dbg;
- void *buffer;
- void *ptr;
-
- /** Stride of the temporary image (not the actual surface) */
- int temp_stride;
-
- void (*unmap)(struct iris_transfer *);
-};
-
/* Compute extent parameters for use with tiled_memcpy functions.
* xs are in units of bytes and ys are in units of strides.
*/
if ((usage & PIPE_TRANSFER_DONTBLOCK) && iris_bo_busy(res->bo))
return NULL;
- struct iris_transfer *map = calloc(1, sizeof(struct iris_transfer));
+ struct iris_transfer *map = slab_alloc(&ice->transfer_pool);
struct pipe_transfer *xfer = &map->base;
// PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE
if (!map)
return NULL;
+ memset(map, 0, sizeof(*map));
map->dbg = &ice->dbg;
pipe_resource_reference(&xfer->resource, resource);
}
static void
-iris_transfer_unmap(struct pipe_context *pipe, struct pipe_transfer *xfer)
+iris_transfer_unmap(struct pipe_context *ctx, struct pipe_transfer *xfer)
{
+ struct iris_context *ice = (struct iris_context *)ctx;
struct iris_transfer *map = (void *) xfer;
if (map->unmap)
map->unmap(map);
pipe_resource_reference(&xfer->resource, NULL);
- free(map);
+ slab_free(&ice->transfer_pool, map);
}
static void
struct iris_state_ref surface_state;
};
+struct iris_transfer {
+ struct pipe_transfer base;
+ struct pipe_debug_callback *dbg;
+ void *buffer;
+ void *ptr;
+
+ /** Stride of the temporary image (not the actual surface) */
+ int temp_stride;
+
+ void (*unmap)(struct iris_transfer *);
+};
+
#endif
screen->compiler->shader_debug_log = iris_shader_debug_log;
screen->compiler->shader_perf_log = iris_shader_perf_log;
+ slab_create_parent(&screen->transfer_pool,
+ sizeof(struct iris_transfer), 64);
+
struct pipe_screen *pscreen = &screen->base;
iris_init_screen_resource_functions(pscreen);