int evergreen_context_init(struct r600_context *ctx)
{
	int r = 0;

	/* add blocks */
	if (ctx->family >= CHIP_CAYMAN)
		r = r600_context_add_block(ctx, cayman_config_reg_list,
					   Elements(cayman_config_reg_list), PKT3_SET_CONFIG_REG, EVERGREEN_CONFIG_REG_OFFSET);
	if (r)
		goto out_err;
	if (ctx->family >= CHIP_CAYMAN)
		r = r600_context_add_block(ctx, cayman_context_reg_list,
					   Elements(cayman_context_reg_list), PKT3_SET_CONTEXT_REG, EVERGREEN_CONTEXT_REG_OFFSET);
	else
		r = r600_context_add_block(ctx, evergreen_context_reg_list,
					   Elements(evergreen_context_reg_list), PKT3_SET_CONTEXT_REG, EVERGREEN_CONTEXT_REG_OFFSET);
	if (r)
		goto out_err;

	r = r600_setup_block_table(ctx);
	if (r)
		goto out_err;

	ctx->max_db = 8;
	return 0;
out_err:
	r600_context_fini(ctx);
	return r;
}
Exemple #2
0
int si_context_init(struct r600_context *ctx)
{
    int r;

    LIST_INITHEAD(&ctx->active_query_list);

    /* init dirty list */
    LIST_INITHEAD(&ctx->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, si_config_reg_list,
                               Elements(si_config_reg_list), PKT3_SET_CONFIG_REG, SI_CONFIG_REG_OFFSET);
    if (r)
        goto out_err;
    r = r600_context_add_block(ctx, si_context_reg_list,
                               Elements(si_context_reg_list), PKT3_SET_CONTEXT_REG, SI_CONTEXT_REG_OFFSET);
    if (r)
        goto out_err;
    r = r600_context_add_block(ctx, si_sh_reg_list,
                               Elements(si_sh_reg_list), PKT3_SET_SH_REG, SI_SH_REG_OFFSET);
    if (r)
        goto out_err;


    /* PS SAMPLER */
    /* VS SAMPLER */

    /* PS SAMPLER BORDER */
    /* VS SAMPLER BORDER */

    /* PS RESOURCES */
    /* VS RESOURCES */

    ctx->cs = ctx->ws->cs_create(ctx->ws);

    r600_init_cs(ctx);
    ctx->max_db = 8;
    return 0;
out_err:
    r600_context_fini(ctx);
    return r;
}
Exemple #3
0
static int evergreen_loop_const_init(struct r600_context *ctx, uint32_t offset)
{
	unsigned nreg = 32;
	struct r600_reg r600_loop_consts[32];
	int i;

	for (i = 0; i < nreg; i++) {
		r600_loop_consts[i].offset = EVERGREEN_LOOP_CONST_OFFSET + ((offset + i) * 4);
		r600_loop_consts[i].flags = REG_FLAG_DIRTY_ALWAYS;
		r600_loop_consts[i].sbu_flags = 0;
	}
	return r600_context_add_block(ctx, r600_loop_consts, nreg, PKT3_SET_LOOP_CONST, EVERGREEN_LOOP_CONST_OFFSET);
}