{
int r;
- LIST_INITHEAD(&ctx->active_query_list);
-
- /* init dirty list */
- LIST_INITHEAD(&ctx->dirty);
- LIST_INITHEAD(&ctx->resource_dirty);
- LIST_INITHEAD(&ctx->enable_list);
-
- ctx->range = calloc(NUM_RANGES, sizeof(struct r600_range));
- if (!ctx->range) {
- r = -ENOMEM;
- goto out_err;
- }
-
/* add blocks */
if (ctx->family == CHIP_CAYMAN)
r = r600_context_add_block(ctx, cayman_config_reg_list,
if (r)
goto out_err;
- ctx->cs = ctx->ws->cs_create(ctx->ws);
- r600_emit_atom(ctx, &ctx->atom_start_cs.atom);
-
ctx->max_db = 8;
return 0;
out_err:
r600_free_resource_range(ctx, &ctx->ps_resources, ctx->num_ps_resources);
r600_free_resource_range(ctx, &ctx->vs_resources, ctx->num_vs_resources);
r600_free_resource_range(ctx, &ctx->fs_resources, ctx->num_fs_resources);
- free(ctx->range);
free(ctx->blocks);
- ctx->ws->cs_destroy(ctx->cs);
}
static void r600_add_resource_block(struct r600_context *ctx, struct r600_range *range, int num_blocks, int *index)
{
int r;
- LIST_INITHEAD(&ctx->active_query_list);
-
- /* init dirty list */
- LIST_INITHEAD(&ctx->dirty);
- LIST_INITHEAD(&ctx->resource_dirty);
- LIST_INITHEAD(&ctx->enable_list);
-
- ctx->range = calloc(NUM_RANGES, sizeof(struct r600_range));
- if (!ctx->range) {
- r = -ENOMEM;
- goto out_err;
- }
-
/* add blocks */
r = r600_context_add_block(ctx, r600_config_reg_list,
Elements(r600_config_reg_list), PKT3_SET_CONFIG_REG, R600_CONFIG_REG_OFFSET);
if (r)
goto out_err;
- ctx->cs = ctx->ws->cs_create(ctx->ws);
- r600_emit_atom(ctx, &ctx->atom_start_cs.atom);
-
ctx->max_db = 4;
return 0;
out_err:
r600_update_num_contexts(rctx->screen, -1);
r600_release_command_buffer(&rctx->atom_start_cs);
+
+ rctx->ws->cs_destroy(rctx->cs);
+
+ FREE(rctx->range);
FREE(rctx);
}
rctx->chip_class = rscreen->chip_class;
LIST_INITHEAD(&rctx->dirty_states);
+ LIST_INITHEAD(&rctx->active_query_list);
+ LIST_INITHEAD(&rctx->dirty);
+ LIST_INITHEAD(&rctx->resource_dirty);
+ LIST_INITHEAD(&rctx->enable_list);
+
+ rctx->range = CALLOC(NUM_RANGES, sizeof(struct r600_range));
+ if (!rctx->range) {
+ FREE(rctx);
+ return NULL;
+ }
r600_init_blit_functions(rctx);
r600_init_query_functions(rctx);
return NULL;
}
+ rctx->cs = rctx->ws->cs_create(rctx->ws);
rctx->ws->cs_set_flush_callback(rctx->cs, r600_flush_from_winsys, rctx);
+ r600_emit_atom(rctx, &rctx->atom_start_cs.atom);
util_slab_create(&rctx->pool_transfers,
sizeof(struct pipe_transfer), 64,