diff options
author | Marek Olšák <[email protected]> | 2012-10-07 03:47:43 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-10-10 00:16:28 +0200 |
commit | eb65fefa4bd5e9a6f08ec599b95f9d63d11c15fa (patch) | |
tree | c602d91ee2cd556d577bee74861ff6a64fda4963 /src/gallium/drivers | |
parent | d8ea64697bbdbc1c7987db00a55954e4cf094ad5 (diff) |
r600g: inline r600_atom_dirty
Reviewed-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_compute.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_blit.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 26 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.h | 5 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_query.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 38 |
8 files changed, 47 insertions, 52 deletions
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index 402d4584d57..8f055bd5f38 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -101,7 +101,7 @@ static void evergreen_cs_set_vertex_buffer( rctx->flags |= R600_CONTEXT_TEX_FLUSH; state->enabled_mask |= 1 << vb_index; state->dirty_mask |= 1 << vb_index; - r600_atom_dirty(rctx, &state->atom); + state->atom.dirty = true; } const struct u_resource_vtbl r600_global_buffer_vtbl = diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index a07302177b3..a3b76d958d4 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1588,11 +1588,11 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx, surf = (struct r600_surface*)state->cbufs[0]; if (rctx->alphatest_state.bypass != surf->alphatest_bypass) { rctx->alphatest_state.bypass = surf->alphatest_bypass; - r600_atom_dirty(rctx, &rctx->alphatest_state.atom); + rctx->alphatest_state.atom.dirty = true; } if (rctx->alphatest_state.cb0_export_16bpc != surf->export_16bpc) { rctx->alphatest_state.cb0_export_16bpc = surf->export_16bpc; - r600_atom_dirty(rctx, &rctx->alphatest_state.atom); + rctx->alphatest_state.atom.dirty = true; } } @@ -1609,18 +1609,18 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx, if (rctx->cb_misc_state.nr_cbufs != state->nr_cbufs) { rctx->cb_misc_state.nr_cbufs = state->nr_cbufs; - r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); + rctx->cb_misc_state.atom.dirty = true; } if (state->nr_cbufs == 0 && rctx->alphatest_state.bypass) { rctx->alphatest_state.bypass = false; - r600_atom_dirty(rctx, &rctx->alphatest_state.atom); + rctx->alphatest_state.atom.dirty = true; } log_samples = util_logbase2(rctx->framebuffer.nr_samples); if (rctx->chip_class == CAYMAN && rctx->db_misc_state.log_samples != log_samples) { rctx->db_misc_state.log_samples = log_samples; - r600_atom_dirty(rctx, &rctx->db_misc_state.atom); + rctx->db_misc_state.atom.dirty = true; } /* Calculate the CS size. */ @@ -1669,7 +1669,7 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx, rctx->framebuffer.atom.num_dw += 4; } - r600_atom_dirty(rctx, &rctx->framebuffer.atom); + rctx->framebuffer.atom.dirty = true; } #define FILL_SREG(s0x, s0y, s1x, s1y, s2x, s2y, s3x, s3y) \ diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 9bbbc454418..062f6d9b227 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -159,7 +159,7 @@ void r600_blit_decompress_depth(struct pipe_context *ctx, rctx->db_misc_state.copy_depth = util_format_has_depth(desc); rctx->db_misc_state.copy_stencil = util_format_has_stencil(desc); rctx->db_misc_state.copy_sample = first_sample; - r600_atom_dirty(rctx, &rctx->db_misc_state.atom); + rctx->db_misc_state.atom.dirty = true; for (level = first_level; level <= last_level; level++) { @@ -177,7 +177,7 @@ void r600_blit_decompress_depth(struct pipe_context *ctx, if (sample != rctx->db_misc_state.copy_sample) { rctx->db_misc_state.copy_sample = sample; - r600_atom_dirty(rctx, &rctx->db_misc_state.atom); + rctx->db_misc_state.atom.dirty = true; } surf_tmpl.format = texture->resource.b.b.format; @@ -217,7 +217,7 @@ void r600_blit_decompress_depth(struct pipe_context *ctx, /* reenable compression in DB_RENDER_CONTROL */ rctx->db_misc_state.flush_depthstencil_through_cb = false; - r600_atom_dirty(rctx, &rctx->db_misc_state.atom); + rctx->db_misc_state.atom.dirty = true; } void r600_decompress_depth_textures(struct r600_context *rctx, diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index 723039a53cc..c457f35f20e 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -878,21 +878,21 @@ void r600_begin_new_cs(struct r600_context *ctx) r600_emit_command_buffer(ctx->cs, &ctx->start_cs_cmd); /* Re-emit states. */ - r600_atom_dirty(ctx, &ctx->alphatest_state.atom); - r600_atom_dirty(ctx, &ctx->blend_color.atom); - r600_atom_dirty(ctx, &ctx->cb_misc_state.atom); - r600_atom_dirty(ctx, &ctx->clip_misc_state.atom); - r600_atom_dirty(ctx, &ctx->clip_state.atom); - r600_atom_dirty(ctx, &ctx->db_misc_state.atom); - r600_atom_dirty(ctx, &ctx->framebuffer.atom); - r600_atom_dirty(ctx, &ctx->vgt_state.atom); - r600_atom_dirty(ctx, &ctx->vgt2_state.atom); - r600_atom_dirty(ctx, &ctx->sample_mask.atom); - r600_atom_dirty(ctx, &ctx->stencil_ref.atom); - r600_atom_dirty(ctx, &ctx->viewport.atom); + ctx->alphatest_state.atom.dirty = true; + ctx->blend_color.atom.dirty = true; + ctx->cb_misc_state.atom.dirty = true; + ctx->clip_misc_state.atom.dirty = true; + ctx->clip_state.atom.dirty = true; + ctx->db_misc_state.atom.dirty = true; + ctx->framebuffer.atom.dirty = true; + ctx->vgt_state.atom.dirty = true; + ctx->vgt2_state.atom.dirty = true; + ctx->sample_mask.atom.dirty = true; + ctx->stencil_ref.atom.dirty = true; + ctx->viewport.atom.dirty = true; if (ctx->chip_class <= R700) { - r600_atom_dirty(ctx, &ctx->seamless_cube_map.atom); + ctx->seamless_cube_map.atom.dirty = true; } ctx->vertex_buffer_state.dirty_mask = ctx->vertex_buffer_state.enabled_mask; diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index be7b891120e..c6e02414830 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -518,11 +518,6 @@ static INLINE void r600_emit_atom(struct r600_context *rctx, struct r600_atom *a atom->dirty = false; } -static INLINE void r600_atom_dirty(struct r600_context *rctx, struct r600_atom *state) -{ - state->dirty = true; -} - /* evergreen_state.c */ struct pipe_sampler_view * evergreen_create_sampler_view_custom(struct pipe_context *ctx, diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c index fef756ddfc5..d35d3fbd0bd 100644 --- a/src/gallium/drivers/r600/r600_query.c +++ b/src/gallium/drivers/r600/r600_query.c @@ -99,7 +99,7 @@ static void r600_update_occlusion_query_state(struct r600_context *rctx, 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); + rctx->db_misc_state.atom.dirty = true; } } } diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 1c24a0b7143..9a6b9f14865 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -1534,7 +1534,7 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx, surf = (struct r600_surface*)state->cbufs[0]; if (rctx->alphatest_state.bypass != surf->alphatest_bypass) { rctx->alphatest_state.bypass = surf->alphatest_bypass; - r600_atom_dirty(rctx, &rctx->alphatest_state.atom); + rctx->alphatest_state.atom.dirty = true; } } @@ -1551,12 +1551,12 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx, if (rctx->cb_misc_state.nr_cbufs != state->nr_cbufs) { rctx->cb_misc_state.nr_cbufs = state->nr_cbufs; - r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); + rctx->cb_misc_state.atom.dirty = true; } if (state->nr_cbufs == 0 && rctx->alphatest_state.bypass) { rctx->alphatest_state.bypass = false; - r600_atom_dirty(rctx, &rctx->alphatest_state.atom); + rctx->alphatest_state.atom.dirty = true; } /* Calculate the CS size. */ @@ -1577,7 +1577,7 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx, rctx->framebuffer.atom.num_dw += 2; } - r600_atom_dirty(rctx, &rctx->framebuffer.atom); + rctx->framebuffer.atom.dirty = true; } #define FILL_SREG(s0x, s0y, s1x, s1y, s2x, s2y, s3x, s3y) \ diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 481ab91c55d..4e336b1b991 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -136,7 +136,7 @@ static void r600_bind_blend_state_internal(struct r600_context *rctx, update_cb = true; } if (update_cb) { - r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); + rctx->cb_misc_state.atom.dirty = true; } } @@ -162,7 +162,7 @@ static void r600_set_blend_color(struct pipe_context *ctx, struct r600_context *rctx = (struct r600_context *)ctx; rctx->blend_color.state = *state; - r600_atom_dirty(rctx, &rctx->blend_color.atom); + rctx->blend_color.atom.dirty = true; } void r600_emit_blend_color(struct r600_context *rctx, struct r600_atom *atom) @@ -201,7 +201,7 @@ static void r600_set_clip_state(struct pipe_context *ctx, struct pipe_constant_buffer cb; rctx->clip_state.state = *state; - r600_atom_dirty(rctx, &rctx->clip_state.atom); + rctx->clip_state.atom.dirty = true; cb.buffer = NULL; cb.user_buffer = state->ucp; @@ -217,7 +217,7 @@ static void r600_set_stencil_ref(struct pipe_context *ctx, struct r600_context *rctx = (struct r600_context *)ctx; rctx->stencil_ref.state = *state; - r600_atom_dirty(rctx, &rctx->stencil_ref.atom); + rctx->stencil_ref.atom.dirty = true; } void r600_emit_stencil_ref(struct r600_context *rctx, struct r600_atom *atom) @@ -285,7 +285,7 @@ static void r600_bind_dsa_state(struct pipe_context *ctx, void *state) rctx->alphatest_state.sx_alpha_ref != dsa->alpha_ref) { rctx->alphatest_state.sx_alpha_test_control = dsa->sx_alpha_test_control; rctx->alphatest_state.sx_alpha_ref = dsa->alpha_ref; - r600_atom_dirty(rctx, &rctx->alphatest_state.atom); + rctx->alphatest_state.atom.dirty = true; } } @@ -330,7 +330,7 @@ static void r600_bind_rs_state(struct pipe_context *ctx, void *state) rctx->clip_misc_state.clip_plane_enable != rs->clip_plane_enable) { rctx->clip_misc_state.pa_cl_clip_cntl = rs->pa_cl_clip_cntl; rctx->clip_misc_state.clip_plane_enable = rs->clip_plane_enable; - r600_atom_dirty(rctx, &rctx->clip_misc_state.atom); + rctx->clip_misc_state.atom.dirty = true; } /* Workaround for a missing scissor enable on r600. */ @@ -380,7 +380,7 @@ void r600_sampler_states_dirty(struct r600_context *rctx, state->atom.num_dw = util_bitcount(state->dirty_mask & state->has_bordercolor_mask) * 11 + util_bitcount(state->dirty_mask & ~state->has_bordercolor_mask) * 5; - r600_atom_dirty(rctx, &state->atom); + state->atom.dirty = true; } } @@ -440,7 +440,7 @@ static void r600_bind_sampler_states(struct pipe_context *pipe, /* change in TA_CNTL_AUX need a pipeline flush */ rctx->flags |= R600_CONTEXT_PS_PARTIAL_FLUSH; rctx->seamless_cube_map.enabled = seamless_cube_map; - r600_atom_dirty(rctx, &rctx->seamless_cube_map.atom); + rctx->seamless_cube_map.atom.dirty = true; } } @@ -519,7 +519,7 @@ void r600_vertex_buffers_dirty(struct r600_context *rctx) rctx->flags |= rctx->has_vertex_cache ? R600_CONTEXT_VTX_FLUSH : R600_CONTEXT_TEX_FLUSH; rctx->vertex_buffer_state.atom.num_dw = (rctx->chip_class >= EVERGREEN ? 12 : 11) * util_bitcount(rctx->vertex_buffer_state.dirty_mask); - r600_atom_dirty(rctx, &rctx->vertex_buffer_state.atom); + rctx->vertex_buffer_state.atom.dirty = true; } } @@ -574,7 +574,7 @@ void r600_sampler_views_dirty(struct r600_context *rctx, rctx->flags |= R600_CONTEXT_TEX_FLUSH; state->atom.num_dw = (rctx->chip_class >= EVERGREEN ? 14 : 13) * util_bitcount(state->dirty_mask); - r600_atom_dirty(rctx, &state->atom); + state->atom.dirty = true; } } @@ -678,7 +678,7 @@ static void r600_set_viewport_state(struct pipe_context *ctx, struct r600_context *rctx = (struct r600_context *)ctx; rctx->viewport.state = *state; - r600_atom_dirty(rctx, &rctx->viewport.atom); + rctx->viewport.atom.dirty = true; } void r600_emit_viewport_state(struct r600_context *rctx, struct r600_atom *atom) @@ -809,7 +809,7 @@ static int r600_shader_select(struct pipe_context *ctx, if (rctx->ps_shader && rctx->cb_misc_state.nr_ps_color_outputs != rctx->ps_shader->current->nr_ps_color_outputs) { rctx->cb_misc_state.nr_ps_color_outputs = rctx->ps_shader->current->nr_ps_color_outputs; - r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); + rctx->cb_misc_state.atom.dirty = true; } return 0; } @@ -859,7 +859,7 @@ static void r600_bind_ps_state(struct pipe_context *ctx, void *state) if (rctx->cb_misc_state.multiwrite != multiwrite) { rctx->cb_misc_state.multiwrite = multiwrite; - r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); + rctx->cb_misc_state.atom.dirty = true; } if (rctx->vs_shader) @@ -868,7 +868,7 @@ static void r600_bind_ps_state(struct pipe_context *ctx, void *state) if (rctx->cb_misc_state.nr_ps_color_outputs != rctx->ps_shader->current->nr_ps_color_outputs) { rctx->cb_misc_state.nr_ps_color_outputs = rctx->ps_shader->current->nr_ps_color_outputs; - r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); + rctx->cb_misc_state.atom.dirty = true; } } @@ -888,7 +888,7 @@ static void r600_bind_vs_state(struct pipe_context *ctx, void *state) rctx->vs_shader->current->shader.clip_dist_write != rctx->clip_misc_state.clip_dist_write) { rctx->clip_misc_state.pa_cl_vs_out_cntl = rctx->vs_shader->current->pa_cl_vs_out_cntl; rctx->clip_misc_state.clip_dist_write = rctx->vs_shader->current->shader.clip_dist_write; - r600_atom_dirty(rctx, &rctx->clip_misc_state.atom); + rctx->clip_misc_state.atom.dirty = true; } } } @@ -939,7 +939,7 @@ void r600_constant_buffers_dirty(struct r600_context *rctx, struct r600_constbuf rctx->flags |= R600_CONTEXT_SHADERCONST_FLUSH; state->atom.num_dw = rctx->chip_class >= EVERGREEN ? util_bitcount(state->dirty_mask)*20 : util_bitcount(state->dirty_mask)*19; - r600_atom_dirty(rctx, &state->atom); + state->atom.dirty = true; } } @@ -1070,7 +1070,7 @@ static void r600_set_sample_mask(struct pipe_context *pipe, unsigned sample_mask return; rctx->sample_mask.sample_mask = sample_mask; - r600_atom_dirty(rctx, &rctx->sample_mask.atom); + rctx->sample_mask.atom.dirty = true; } static void r600_update_derived_state(struct r600_context *rctx) @@ -1214,13 +1214,13 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info /* Set the index offset and multi primitive */ if (rctx->vgt2_state.vgt_indx_offset != info.index_bias) { rctx->vgt2_state.vgt_indx_offset = info.index_bias; - r600_atom_dirty(rctx, &rctx->vgt2_state.atom); + rctx->vgt2_state.atom.dirty = true; } if (rctx->vgt_state.vgt_multi_prim_ib_reset_en != info.primitive_restart || rctx->vgt_state.vgt_multi_prim_ib_reset_indx != info.restart_index) { rctx->vgt_state.vgt_multi_prim_ib_reset_en = info.primitive_restart; rctx->vgt_state.vgt_multi_prim_ib_reset_indx = info.restart_index; - r600_atom_dirty(rctx, &rctx->vgt_state.atom); + rctx->vgt_state.atom.dirty = true; } /* Emit states (the function expects that we emit at most 17 dwords here). */ |