void r600_common_context_cleanup(struct r600_common_context *rctx) { unsigned i,j; /* Release DCC stats. */ for (i = 0; i < ARRAY_SIZE(rctx->dcc_stats); i++) { assert(!rctx->dcc_stats[i].query_active); for (j = 0; j < ARRAY_SIZE(rctx->dcc_stats[i].ps_stats); j++) if (rctx->dcc_stats[i].ps_stats[j]) rctx->b.destroy_query(&rctx->b, rctx->dcc_stats[i].ps_stats[j]); r600_texture_reference(&rctx->dcc_stats[i].tex, NULL); } if (rctx->gfx.cs) rctx->ws->cs_destroy(rctx->gfx.cs); if (rctx->dma.cs) rctx->ws->cs_destroy(rctx->dma.cs); if (rctx->ctx) rctx->ws->ctx_destroy(rctx->ctx); if (rctx->uploader) { u_upload_destroy(rctx->uploader); } util_slab_destroy(&rctx->pool_transfers); if (rctx->allocator_zeroed_memory) { u_suballocator_destroy(rctx->allocator_zeroed_memory); } rctx->ws->fence_reference(&rctx->last_sdma_fence, NULL); }
static void vc4_context_destroy(struct pipe_context *pctx) { struct vc4_context *vc4 = vc4_context(pctx); if (vc4->blitter) util_blitter_destroy(vc4->blitter); if (vc4->primconvert) util_primconvert_destroy(vc4->primconvert); if (vc4->uploader) u_upload_destroy(vc4->uploader); util_slab_destroy(&vc4->transfer_pool); pipe_surface_reference(&vc4->framebuffer.cbufs[0], NULL); pipe_surface_reference(&vc4->framebuffer.zsbuf, NULL); pipe_surface_reference(&vc4->color_write, NULL); pipe_surface_reference(&vc4->color_read, NULL); vc4_program_fini(pctx); ralloc_free(vc4); }
static void ilo_context_destroy(struct pipe_context *pipe) { struct ilo_context *ilo = ilo_context(pipe); ilo_cleanup_states(ilo); if (ilo->last_cp_bo) intel_bo_unreference(ilo->last_cp_bo); if (ilo->uploader) u_upload_destroy(ilo->uploader); if (ilo->blitter) ilo_blitter_destroy(ilo->blitter); if (ilo->hw3d) ilo_3d_destroy(ilo->hw3d); if (ilo->shader_cache) ilo_shader_cache_destroy(ilo->shader_cache); if (ilo->cp) ilo_cp_destroy(ilo->cp); util_slab_destroy(&ilo->transfer_mempool); FREE(ilo); }
static void r600_destroy_context(struct pipe_context *context) { struct r600_context *rctx = (struct r600_context *)context; si_release_all_descriptors(rctx); pipe_resource_reference(&rctx->null_const_buf.buffer, NULL); r600_resource_reference(&rctx->border_color_table, NULL); if (rctx->dummy_pixel_shader) { rctx->b.b.delete_fs_state(&rctx->b.b, rctx->dummy_pixel_shader); } for (int i = 0; i < 8; i++) { rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush_depth_stencil[i]); rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush_depth[i]); rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush_stencil[i]); } rctx->b.b.delete_depth_stencil_alpha_state(&rctx->b.b, rctx->custom_dsa_flush_inplace); rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_resolve); rctx->b.b.delete_blend_state(&rctx->b.b, rctx->custom_blend_decompress); util_unreference_framebuffer_state(&rctx->framebuffer); util_blitter_destroy(rctx->blitter); if (rctx->uploader) { u_upload_destroy(rctx->uploader); } util_slab_destroy(&rctx->pool_transfers); r600_common_context_cleanup(&rctx->b); FREE(rctx); }
static void r300_destroy_context(struct pipe_context* context) { struct r300_context* r300 = r300_context(context); if (r300->cs && r300->hyperz_enabled) { r300->rws->cs_request_feature(r300->cs, RADEON_FID_R300_HYPERZ_ACCESS, FALSE); } if (r300->cs && r300->cmask_access) { r300->rws->cs_request_feature(r300->cs, RADEON_FID_R300_CMASK_ACCESS, FALSE); } if (r300->blitter) util_blitter_destroy(r300->blitter); if (r300->draw) draw_destroy(r300->draw); if (r300->uploader) u_upload_destroy(r300->uploader); /* XXX: This function assumes r300->query_list was initialized */ r300_release_referenced_objects(r300); if (r300->cs) r300->rws->cs_destroy(r300->cs); if (r300->ctx) r300->rws->ctx_destroy(r300->ctx); rc_destroy_regalloc_state(&r300->fs_regalloc_state); /* XXX: No way to tell if this was initialized or not? */ util_slab_destroy(&r300->pool_transfers); /* Free the structs allocated in r300_setup_atoms() */ if (r300->aa_state.state) { FREE(r300->aa_state.state); FREE(r300->blend_color_state.state); FREE(r300->clip_state.state); FREE(r300->fb_state.state); FREE(r300->gpu_flush.state); FREE(r300->hyperz_state.state); FREE(r300->invariant_state.state); FREE(r300->rs_block_state.state); FREE(r300->sample_mask.state); FREE(r300->scissor_state.state); FREE(r300->textures_state.state); FREE(r300->vap_invariant_state.state); FREE(r300->viewport_state.state); FREE(r300->ztop_state.state); FREE(r300->fs_constants.state); FREE(r300->vs_constants.state); if (!r300->screen->caps.has_tcl) { FREE(r300->vertex_stream_state.state); } } FREE(r300); }
/** * Clean up the toy compiler. */ void toy_compiler_cleanup(struct toy_compiler *tc) { struct toy_inst *inst, *next; LIST_FOR_EACH_ENTRY_SAFE(inst, next, &tc->instructions, list) util_slab_free(&tc->mempool, inst); util_slab_destroy(&tc->mempool); }
static void r300_destroy_screen(struct pipe_screen* pscreen) { struct r300_screen* r300screen = r300_screen(pscreen); struct radeon_winsys *rws = radeon_winsys(pscreen); util_slab_destroy(&r300screen->pool_buffers); pipe_mutex_destroy(r300screen->num_contexts_mutex); if (rws) rws->destroy(rws); FREE(r300screen); }
static void vc4_context_destroy(struct pipe_context *pctx) { struct vc4_context *vc4 = vc4_context(pctx); if (vc4->blitter) util_blitter_destroy(vc4->blitter); if (vc4->primconvert) util_primconvert_destroy(vc4->primconvert); util_slab_destroy(&vc4->transfer_pool); ralloc_free(vc4); }
void r600_common_context_cleanup(struct r600_common_context *rctx) { if (rctx->rings.gfx.cs) rctx->ws->cs_destroy(rctx->rings.gfx.cs); if (rctx->rings.dma.cs) rctx->ws->cs_destroy(rctx->rings.dma.cs); if (rctx->ctx) rctx->ws->ctx_destroy(rctx->ctx); if (rctx->uploader) { u_upload_destroy(rctx->uploader); } util_slab_destroy(&rctx->pool_transfers); if (rctx->allocator_so_filled_size) { u_suballocator_destroy(rctx->allocator_so_filled_size); } }
void r600_common_context_cleanup(struct r600_common_context *rctx) { if (rctx->gfx.cs) rctx->ws->cs_destroy(rctx->gfx.cs); if (rctx->dma.cs) rctx->ws->cs_destroy(rctx->dma.cs); if (rctx->ctx) rctx->ws->ctx_destroy(rctx->ctx); if (rctx->uploader) { u_upload_destroy(rctx->uploader); } util_slab_destroy(&rctx->pool_transfers); if (rctx->allocator_so_filled_size) { u_suballocator_destroy(rctx->allocator_so_filled_size); } rctx->ws->fence_reference(&rctx->last_sdma_fence, NULL); }
void fd_context_destroy(struct pipe_context *pctx) { struct fd_context *ctx = fd_context(pctx); unsigned i; DBG(""); fd_prog_fini(pctx); fd_hw_query_fini(pctx); util_dynarray_fini(&ctx->draw_patches); if (ctx->blitter) util_blitter_destroy(ctx->blitter); if (ctx->primconvert) util_primconvert_destroy(ctx->primconvert); util_slab_destroy(&ctx->transfer_pool); fd_ringmarker_del(ctx->draw_start); fd_ringmarker_del(ctx->draw_end); fd_ringmarker_del(ctx->binning_start); fd_ringmarker_del(ctx->binning_end); for (i = 0; i < ARRAY_SIZE(ctx->rings); i++) fd_ringbuffer_del(ctx->rings[i]); for (i = 0; i < ARRAY_SIZE(ctx->pipe); i++) { struct fd_vsc_pipe *pipe = &ctx->pipe[i]; if (!pipe->bo) break; fd_bo_del(pipe->bo); } fd_device_del(ctx->dev); FREE(ctx); }
static void ilo_context_destroy(struct pipe_context *pipe) { struct ilo_context *ilo = ilo_context(pipe); ilo_state_vector_cleanup(&ilo->state_vector); if (ilo->uploader) u_upload_destroy(ilo->uploader); if (ilo->blitter) ilo_blitter_destroy(ilo->blitter); if (ilo->render) ilo_render_destroy(ilo->render); if (ilo->shader_cache) ilo_shader_cache_destroy(ilo->shader_cache); if (ilo->cp) ilo_cp_destroy(ilo->cp); util_slab_destroy(&ilo->transfer_mempool); FREE(ilo); }
void etna_pipe_transfer_destroy(struct pipe_context *pc) { struct etna_pipe_context *priv = etna_pipe_context(pc); util_slab_destroy(&priv->transfer_pool); }