struct radeon_winsys_cs *cs = ctx->cs;
bool enable = buffer_enable_bit != 0;
- if (enable != ctx->atom_eg_strmout_config.stream0_enable) {
- ctx->atom_eg_strmout_config.stream0_enable = enable;
- r600_emit_atom(ctx, &ctx->atom_eg_strmout_config.atom);
+ if (enable != ctx->eg_streamout_state.stream0_enable) {
+ ctx->eg_streamout_state.stream0_enable = enable;
+ r600_emit_atom(ctx, &ctx->eg_streamout_state.atom);
}
if (buffer_enable_bit) {
{
struct r600_context *rctx = (struct r600_context*)ctx;
- if (discard != rctx->atom_eg_strmout_config.rasterizer_discard) {
- rctx->atom_eg_strmout_config.rasterizer_discard = discard;
- r600_atom_dirty(rctx, &rctx->atom_eg_strmout_config.atom);
+ if (discard != rctx->eg_streamout_state.rasterizer_discard) {
+ rctx->eg_streamout_state.rasterizer_discard = discard;
+ r600_atom_dirty(rctx, &rctx->eg_streamout_state.atom);
}
}
static void evergreen_emit_db_misc_state(struct r600_context *rctx, struct r600_atom *atom)
{
struct radeon_winsys_cs *cs = rctx->cs;
- struct r600_atom_db_misc_state *a = (struct r600_atom_db_misc_state*)atom;
+ struct r600_db_misc_state *a = (struct r600_db_misc_state*)atom;
unsigned db_count_control = 0;
unsigned db_render_override =
S_02800C_FORCE_HIZ_ENABLE(V_02800C_FORCE_DISABLE) |
static void evergreen_emit_streamout_config(struct r600_context *rctx, struct r600_atom *atom)
{
struct radeon_winsys_cs *cs = rctx->cs;
- struct r600_atom_eg_strmout_config *a = (struct r600_atom_eg_strmout_config*)atom;
+ struct r600_eg_streamout_state *a = (struct r600_eg_streamout_state*)atom;
r600_write_context_reg(cs, R_028B94_VGT_STRMOUT_CONFIG,
S_028B94_STREAMOUT_0_EN(a->stream0_enable) |
void evergreen_init_state_functions(struct r600_context *rctx)
{
- r600_init_atom(&rctx->atom_db_misc_state.atom, evergreen_emit_db_misc_state, 6, 0);
- r600_atom_dirty(rctx, &rctx->atom_db_misc_state.atom);
- r600_init_atom(&rctx->atom_eg_strmout_config.atom, evergreen_emit_streamout_config, 6, 0);
- r600_atom_dirty(rctx, &rctx->atom_eg_strmout_config.atom);
+ r600_init_atom(&rctx->db_misc_state.atom, evergreen_emit_db_misc_state, 6, 0);
+ r600_atom_dirty(rctx, &rctx->db_misc_state.atom);
+ r600_init_atom(&rctx->eg_streamout_state.atom, evergreen_emit_streamout_config, 6, 0);
+ r600_atom_dirty(rctx, &rctx->eg_streamout_state.atom);
rctx->context.create_blend_state = evergreen_create_blend_state;
rctx->context.create_depth_stencil_alpha_state = evergreen_create_dsa_state;
static void cayman_init_atom_start_cs(struct r600_context *rctx)
{
- struct r600_command_buffer *cb = &rctx->atom_start_cs;
+ struct r600_command_buffer *cb = &rctx->start_cs_cmd;
r600_init_command_buffer(cb, 256, EMIT_EARLY);
void evergreen_init_atom_start_cs(struct r600_context *rctx)
{
- struct r600_command_buffer *cb = &rctx->atom_start_cs;
+ struct r600_command_buffer *cb = &rctx->start_cs_cmd;
int ps_prio;
int vs_prio;
int gs_prio;
void r600_inval_shader_cache(struct r600_context *ctx)
{
- ctx->atom_surface_sync.flush_flags |= S_0085F0_SH_ACTION_ENA(1);
- r600_atom_dirty(ctx, &ctx->atom_surface_sync.atom);
+ ctx->surface_sync_cmd.flush_flags |= S_0085F0_SH_ACTION_ENA(1);
+ r600_atom_dirty(ctx, &ctx->surface_sync_cmd.atom);
}
void r600_inval_texture_cache(struct r600_context *ctx)
{
- ctx->atom_surface_sync.flush_flags |= S_0085F0_TC_ACTION_ENA(1);
- r600_atom_dirty(ctx, &ctx->atom_surface_sync.atom);
+ ctx->surface_sync_cmd.flush_flags |= S_0085F0_TC_ACTION_ENA(1);
+ r600_atom_dirty(ctx, &ctx->surface_sync_cmd.atom);
}
void r600_inval_vertex_cache(struct r600_context *ctx)
ctx->family == CHIP_CAICOS ||
ctx->family == CHIP_CAYMAN) {
/* Some GPUs don't have the vertex cache and must use the texture cache instead. */
- ctx->atom_surface_sync.flush_flags |= S_0085F0_TC_ACTION_ENA(1);
+ ctx->surface_sync_cmd.flush_flags |= S_0085F0_TC_ACTION_ENA(1);
} else {
- ctx->atom_surface_sync.flush_flags |= S_0085F0_VC_ACTION_ENA(1);
+ ctx->surface_sync_cmd.flush_flags |= S_0085F0_VC_ACTION_ENA(1);
}
- r600_atom_dirty(ctx, &ctx->atom_surface_sync.atom);
+ r600_atom_dirty(ctx, &ctx->surface_sync_cmd.atom);
}
void r600_flush_framebuffer(struct r600_context *ctx, bool flush_now)
if (!(ctx->flags & R600_CONTEXT_DST_CACHES_DIRTY))
return;
- ctx->atom_surface_sync.flush_flags |=
+ ctx->surface_sync_cmd.flush_flags |=
r600_get_cb_flush_flags(ctx) |
(ctx->framebuffer.zsbuf ? S_0085F0_DB_ACTION_ENA(1) | S_0085F0_DB_DEST_BASE_ENA(1) : 0);
if (flush_now) {
- r600_emit_atom(ctx, &ctx->atom_surface_sync.atom);
+ r600_emit_atom(ctx, &ctx->surface_sync_cmd.atom);
} else {
- r600_atom_dirty(ctx, &ctx->atom_surface_sync.atom);
+ r600_atom_dirty(ctx, &ctx->surface_sync_cmd.atom);
}
/* Also add a complete cache flush to work around broken flushing on R6xx. */
if (ctx->chip_class == R600) {
if (flush_now) {
- r600_emit_atom(ctx, &ctx->atom_r6xx_flush_and_inv);
+ r600_emit_atom(ctx, &ctx->r6xx_flush_and_inv_cmd);
} else {
- r600_atom_dirty(ctx, &ctx->atom_r6xx_flush_and_inv);
+ r600_atom_dirty(ctx, &ctx->r6xx_flush_and_inv_cmd);
}
}
bool nontimer_queries_suspended = false;
bool streamout_suspended = false;
- if (cs->cdw == ctx->atom_start_cs.atom.num_dw)
+ if (cs->cdw == ctx->start_cs_cmd.atom.num_dw)
return;
/* suspend queries */
ctx->pm4_dirty_cdwords = 0;
ctx->flags = 0;
- r600_emit_atom(ctx, &ctx->atom_start_cs.atom);
- r600_atom_dirty(ctx, &ctx->atom_db_misc_state.atom);
+ r600_emit_atom(ctx, &ctx->start_cs_cmd.atom);
+ r600_atom_dirty(ctx, &ctx->db_misc_state.atom);
if (ctx->chip_class >= EVERGREEN)
- r600_atom_dirty(ctx, &ctx->atom_eg_strmout_config.atom);
+ r600_atom_dirty(ctx, &ctx->eg_streamout_state.atom);
if (streamout_suspended) {
ctx->streamout_start = TRUE;
flush_flags |= S_0085F0_DEST_BASE_0_ENA(1);
}
- r600_atom_dirty(ctx, &ctx->atom_r6xx_flush_and_inv);
+ r600_atom_dirty(ctx, &ctx->r6xx_flush_and_inv_cmd);
}
/* Flush streamout caches. */
- ctx->atom_surface_sync.flush_flags |= flush_flags;
- r600_atom_dirty(ctx, &ctx->atom_surface_sync.atom);
+ ctx->surface_sync_cmd.flush_flags |= flush_flags;
+ r600_atom_dirty(ctx, &ctx->surface_sync_cmd.atom);
ctx->num_cs_dw_streamout_end = 0;
r600_update_num_contexts(rctx->screen, -1);
- r600_release_command_buffer(&rctx->atom_start_cs);
+ r600_release_command_buffer(&rctx->start_cs_cmd);
if (rctx->cs) {
rctx->ws->cs_destroy(rctx->cs);
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);
+ r600_emit_atom(rctx, &rctx->start_cs_cmd.atom);
rctx->vbuf_mgr = u_vbuf_create(&rctx->context, 1024 * 1024, 256,
PIPE_BIND_VERTEX_BUFFER |
unsigned max_num_dw;
};
-struct r600_atom_surface_sync {
+struct r600_surface_sync_cmd {
struct r600_atom atom;
unsigned flush_flags; /* CP_COHER_CNTL */
};
-struct r600_atom_db_misc_state {
+struct r600_db_misc_state {
struct r600_atom atom;
bool occlusion_query_enabled;
bool flush_depthstencil_enabled;
};
-struct r600_atom_eg_strmout_config {
+struct r600_eg_streamout_state {
struct r600_atom atom;
bool rasterizer_discard;
bool stream0_enable;
unsigned default_ps_gprs, default_vs_gprs;
- /* States based on r600_state. */
+ /* States based on r600_atom. */
struct list_head dirty_states;
- struct r600_command_buffer atom_start_cs; /* invariant state mostly */
- struct r600_atom_surface_sync atom_surface_sync;
- struct r600_atom atom_r6xx_flush_and_inv;
- struct r600_atom_db_misc_state atom_db_misc_state;
- struct r600_atom_eg_strmout_config atom_eg_strmout_config;
+ struct r600_command_buffer start_cs_cmd; /* invariant state mostly */
+ struct r600_surface_sync_cmd surface_sync_cmd;
+ struct r600_atom r6xx_flush_and_inv_cmd;
+ struct r600_db_misc_state db_misc_state;
+ struct r600_eg_streamout_state eg_streamout_state;
/* Below are variables from the old r600_context.
*/
enable = rctx->num_occlusion_queries != 0;
- if (rctx->atom_db_misc_state.occlusion_query_enabled != enable) {
- rctx->atom_db_misc_state.occlusion_query_enabled = enable;
- r600_atom_dirty(rctx, &rctx->atom_db_misc_state.atom);
+ if (rctx->db_misc_state.occlusion_query_enabled != enable) {
+ rctx->db_misc_state.occlusion_query_enabled = enable;
+ r600_atom_dirty(rctx, &rctx->db_misc_state.atom);
}
}
}
static void r600_emit_db_misc_state(struct r600_context *rctx, struct r600_atom *atom)
{
struct radeon_winsys_cs *cs = rctx->cs;
- struct r600_atom_db_misc_state *a = (struct r600_atom_db_misc_state*)atom;
+ struct r600_db_misc_state *a = (struct r600_db_misc_state*)atom;
unsigned db_render_control = 0;
unsigned db_render_override =
S_028D10_FORCE_HIZ_ENABLE(V_028D10_FORCE_DISABLE) |
void r600_init_state_functions(struct r600_context *rctx)
{
- r600_init_atom(&rctx->atom_db_misc_state.atom, r600_emit_db_misc_state, 4, 0);
- r600_atom_dirty(rctx, &rctx->atom_db_misc_state.atom);
+ r600_init_atom(&rctx->db_misc_state.atom, r600_emit_db_misc_state, 4, 0);
+ r600_atom_dirty(rctx, &rctx->db_misc_state.atom);
rctx->context.create_blend_state = r600_create_blend_state;
rctx->context.create_depth_stencil_alpha_state = r600_create_dsa_state;
int num_gs_stack_entries;
int num_es_stack_entries;
enum radeon_family family;
- struct r600_command_buffer *cb = &rctx->atom_start_cs;
+ struct r600_command_buffer *cb = &rctx->start_cs_cmd;
uint32_t tmp;
unsigned i;
static void r600_emit_surface_sync(struct r600_context *rctx, struct r600_atom *atom)
{
struct radeon_winsys_cs *cs = rctx->cs;
- struct r600_atom_surface_sync *a = (struct r600_atom_surface_sync*)atom;
+ struct r600_surface_sync_cmd *a = (struct r600_surface_sync_cmd*)atom;
cs->buf[cs->cdw++] = PKT3(PKT3_SURFACE_SYNC, 3, 0);
cs->buf[cs->cdw++] = a->flush_flags; /* CP_COHER_CNTL */
void r600_init_common_atoms(struct r600_context *rctx)
{
- r600_init_atom(&rctx->atom_surface_sync.atom, r600_emit_surface_sync, 5, EMIT_EARLY);
- r600_init_atom(&rctx->atom_r6xx_flush_and_inv, r600_emit_r6xx_flush_and_inv, 2, EMIT_EARLY);
+ r600_init_atom(&rctx->surface_sync_cmd.atom, r600_emit_surface_sync, 5, EMIT_EARLY);
+ r600_init_atom(&rctx->r6xx_flush_and_inv_cmd, r600_emit_r6xx_flush_and_inv, 2, EMIT_EARLY);
}
unsigned r600_get_cb_flush_flags(struct r600_context *rctx)
{
struct r600_context *rctx = (struct r600_context *)ctx;
- rctx->atom_surface_sync.flush_flags |= S_0085F0_TC_ACTION_ENA(1) | r600_get_cb_flush_flags(rctx);
- r600_atom_dirty(rctx, &rctx->atom_surface_sync.atom);
+ rctx->surface_sync_cmd.flush_flags |= S_0085F0_TC_ACTION_ENA(1) | r600_get_cb_flush_flags(rctx);
+ r600_atom_dirty(rctx, &rctx->surface_sync_cmd.atom);
}
static bool r600_conv_pipe_prim(unsigned pprim, unsigned *prim)
r600_set_stencil_ref(ctx, &ref);
- if (rctx->atom_db_misc_state.flush_depthstencil_enabled != dsa->is_flush) {
- rctx->atom_db_misc_state.flush_depthstencil_enabled = dsa->is_flush;
- r600_atom_dirty(rctx, &rctx->atom_db_misc_state.atom);
+ if (rctx->db_misc_state.flush_depthstencil_enabled != dsa->is_flush) {
+ rctx->db_misc_state.flush_depthstencil_enabled = dsa->is_flush;
+ r600_atom_dirty(rctx, &rctx->db_misc_state.atom);
}
}