Ejemplo n.º 1
0
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;
}
Ejemplo n.º 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;
}