dEQP-GLES2.functional.fragment_ops.random.98
dEQP-GLES2.functional.fragment_ops.random.99
dEQP-GLES2.functional.lifetime.attach.deleted_output.renderbuffer_framebuffer
-dEQP-GLES2.functional.lifetime.attach.deleted_output.texture_framebuffer
dEQP-GLES2.functional.negative_api.shader.uniform_matrixfv_invalid_transpose
dEQP-GLES2.functional.negative_api.texture.generatemipmap_zero_level_array_compressed
dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units
pbuf->size = sz;
if (pbuf->buffer) {
- free(pbuf->buffer);
+ ralloc_free(pbuf->buffer);
pbuf->buffer = NULL;
}
/* Copy the constant buffer into the driver context for later upload */
- pbuf->buffer = malloc(sz);
+ pbuf->buffer = rzalloc_size(ctx, sz);
memcpy(pbuf->buffer, cpu + buf->buffer_offset, sz);
}
struct pipe_resource *texture,
const struct pipe_sampler_view *template)
{
- struct panfrost_sampler_view *so = CALLOC_STRUCT(panfrost_sampler_view);
+ struct panfrost_sampler_view *so = rzalloc(pctx, struct panfrost_sampler_view);
int bytes_per_pixel = util_format_get_blocksize(texture->format);
pipe_reference(NULL, &texture->reference);
struct pipe_sampler_view *view)
{
pipe_resource_reference(&view->texture, NULL);
- free(view);
+ ralloc_free(view);
}
static void
const struct pipe_blend_state *blend)
{
struct panfrost_context *ctx = pan_context(pipe);
- struct panfrost_blend_state *so = CALLOC_STRUCT(panfrost_blend_state);
+ struct panfrost_blend_state *so = rzalloc(ctx, struct panfrost_blend_state);
so->base = *blend;
/* TODO: The following features are not yet implemented */
DBG("Deleting blend state leak blend shaders bytecode\n");
}
- free(blend);
+ ralloc_free(blend);
}
static void
screen->driver->free_slab(screen, &panfrost->shaders);
screen->driver->free_slab(screen, &panfrost->tiler_heap);
screen->driver->free_slab(screen, &panfrost->tiler_polygon_list);
+
+ ralloc_free(pipe);
}
static struct pipe_query *
unsigned type,
unsigned index)
{
- struct panfrost_query *q = CALLOC_STRUCT(panfrost_query);
+ struct panfrost_query *q = rzalloc(pipe, struct panfrost_query);
q->type = type;
q->index = index;
static void
panfrost_destroy_query(struct pipe_context *pipe, struct pipe_query *q)
{
- FREE(q);
+ ralloc_free(q);
}
static boolean
{
struct pipe_stream_output_target *target;
- target = CALLOC_STRUCT(pipe_stream_output_target);
+ target = rzalloc(pctx, struct pipe_stream_output_target);
if (!target)
return NULL;
struct pipe_stream_output_target *target)
{
pipe_resource_reference(&target->buffer, NULL);
- free(target);
+ ralloc_free(target);
}
static void
struct pipe_context *
panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
{
- struct panfrost_context *ctx = CALLOC_STRUCT(panfrost_context);
+ struct panfrost_context *ctx = rzalloc(screen, struct panfrost_context);
struct panfrost_screen *pscreen = pan_screen(screen);
memset(ctx, 0, sizeof(*ctx));
struct pipe_context *gallium = (struct pipe_context *) ctx;
static struct panfrost_bo *
panfrost_drm_import_bo(struct panfrost_screen *screen, struct winsys_handle *whandle)
{
- struct panfrost_bo *bo = CALLOC_STRUCT(panfrost_bo);
+ struct panfrost_bo *bo = rzalloc(screen, struct panfrost_bo);
struct panfrost_drm *drm = (struct panfrost_drm *)screen->driver;
struct drm_panfrost_get_bo_offset get_bo_offset = {0,};
struct drm_panfrost_mmap_bo mmap_bo = {0,};
void
panfrost_job_init(struct panfrost_context *ctx)
{
- /* TODO: Don't leak */
- ctx->jobs = _mesa_hash_table_create(NULL,
+ ctx->jobs = _mesa_hash_table_create(ctx,
panfrost_job_hash,
panfrost_job_compare);
- ctx->write_jobs = _mesa_hash_table_create(NULL,
+ ctx->write_jobs = _mesa_hash_table_create(ctx,
_mesa_hash_pointer,
_mesa_key_pointer_equal);
-
}
assert(whandle->type == WINSYS_HANDLE_TYPE_FD);
- rsc = CALLOC_STRUCT(panfrost_resource);
+ rsc = rzalloc(pscreen, struct panfrost_resource);
if (!rsc)
return NULL;
{
struct pipe_surface *ps = NULL;
- ps = CALLOC_STRUCT(pipe_surface);
+ ps = rzalloc(pipe, struct pipe_surface);
if (ps) {
pipe_reference_init(&ps->reference, 1);
{
assert(surf->texture);
pipe_resource_reference(&surf->texture, NULL);
- free(surf);
+ ralloc_free(surf);
}
static void
static struct panfrost_bo *
panfrost_create_bo(struct panfrost_screen *screen, const struct pipe_resource *template)
{
- struct panfrost_bo *bo = CALLOC_STRUCT(panfrost_bo);
+ struct panfrost_bo *bo = rzalloc(screen, struct panfrost_bo);
pipe_reference_init(&bo->reference, 1);
/* Based on the usage, figure out what storing will be used. There are
panfrost_resource_create(struct pipe_screen *screen,
const struct pipe_resource *template)
{
- struct panfrost_resource *so = CALLOC_STRUCT(panfrost_resource);
+ struct panfrost_resource *so = rzalloc(screen, struct panfrost_resource);
struct panfrost_screen *pscreen = (struct panfrost_screen *) screen;
so->base = *template;
}
static void
-panfrost_destroy_bo(struct panfrost_screen *screen, struct panfrost_bo *pbo)
+panfrost_destroy_bo(struct panfrost_screen *screen, struct panfrost_bo *bo)
{
- struct panfrost_bo *bo = (struct panfrost_bo *)pbo;
-
if ((bo->layout == PAN_LINEAR || bo->layout == PAN_TILED) &&
!bo->imported) {
struct panfrost_memory mem = {
if (bo->imported) {
screen->driver->free_imported_bo(screen, bo);
}
+
+ ralloc_free(bo);
}
void
panfrost_bo_unreference(screen, rsrc->bo);
util_range_destroy(&rsrc->valid_buffer_range);
- FREE(rsrc);
+ ralloc_free(rsrc);
}
static void *
struct panfrost_resource *rsrc = pan_resource(resource);
struct panfrost_bo *bo = rsrc->bo;
- struct panfrost_gtransfer *transfer = CALLOC_STRUCT(panfrost_gtransfer);
+ struct panfrost_gtransfer *transfer = rzalloc(pctx, struct panfrost_gtransfer);
transfer->base.level = level;
transfer->base.usage = usage;
transfer->base.box = *box;
transfer->base.layer_stride = transfer->base.stride * box->height;
/* TODO: Reads */
- transfer->map = malloc(transfer->base.layer_stride * box->depth);
+ transfer->map = rzalloc_size(transfer, transfer->base.layer_stride * box->depth);
return transfer->map;
} else {
panfrost_tile_texture(screen, prsrc, trans);
}
}
-
- free(trans->map);
}
/* Derefence the resource */
pipe_resource_reference(&transfer->resource, NULL);
- /* Transfer itself is CALLOCed at the moment */
- free(transfer);
+ /* Transfer itself is RALLOCed at the moment */
+ ralloc_free(transfer);
}
static void
panfrost_slab_alloc(void *priv, unsigned heap, unsigned entry_size, unsigned group_index)
{
struct panfrost_screen *screen = (struct panfrost_screen *) priv;
- struct panfrost_memory *mem = CALLOC_STRUCT(panfrost_memory);
+ struct panfrost_memory *mem = rzalloc(screen, struct panfrost_memory);
size_t slab_size = (1 << (MAX_SLAB_ENTRY_SIZE + 1));
LIST_INITHEAD(&mem->slab.free);
for (unsigned i = 0; i < mem->slab.num_entries; ++i) {
/* Create a slab entry */
- struct panfrost_memory_entry *entry = CALLOC_STRUCT(panfrost_memory_entry);
+ struct panfrost_memory_entry *entry = rzalloc(mem, struct panfrost_memory_entry);
entry->offset = entry_size * i;
entry->base.slab = &mem->slab;
struct panfrost_screen *screen = (struct panfrost_screen *) priv;
screen->driver->free_slab(screen, mem);
+ ralloc_free(mem);
}
static void
panfrost_slab_free);
}
+void
+panfrost_resource_screen_deinit(struct panfrost_screen *pscreen)
+{
+ pb_slabs_deinit(&pscreen->slabs);
+}
+
void
panfrost_resource_context_init(struct pipe_context *pctx)
{
}
void panfrost_resource_screen_init(struct panfrost_screen *screen);
+void panfrost_resource_screen_deinit(struct panfrost_screen *screen);
void panfrost_resource_context_init(struct pipe_context *pctx);
static void
-panfrost_destroy_screen( struct pipe_screen *screen )
+panfrost_destroy_screen(struct pipe_screen *pscreen)
{
- FREE(screen);
+ struct panfrost_screen *screen = pan_screen(pscreen);
+ panfrost_resource_screen_deinit(screen);
+ ralloc_free(screen);
}
static void
struct pipe_screen *
panfrost_create_screen(int fd, struct renderonly *ro)
{
- struct panfrost_screen *screen = CALLOC_STRUCT(panfrost_screen);
+ struct panfrost_screen *screen = rzalloc(NULL, struct panfrost_screen);
pan_debug = debug_get_option_pan_debug();