summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-04-12 18:12:11 +0200
committerMarek Olšák <[email protected]>2014-04-16 14:02:52 +0200
commit11459436d9314681087463f2c006c58b6fcff396 (patch)
tree3620c11c52f31e266783bfd74ad2d92bba3575f7 /src/gallium/drivers/radeonsi
parentadfadeadd8316e95626fec4771393d32a70af649 (diff)
r600g,radeonsi: share some of gfx flush code
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_hw_context.c44
1 files changed, 3 insertions, 41 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
index 37ca290291f..185041e9598 100644
--- a/src/gallium/drivers/radeonsi/si_hw_context.c
+++ b/src/gallium/drivers/radeonsi/si_hw_context.c
@@ -88,30 +88,7 @@ void si_context_gfx_flush(void *context, unsigned flags,
ctx->b.rings.gfx.flushing = true;
- /* Disable render condition. */
- ctx->b.saved_render_cond = NULL;
- ctx->b.saved_render_cond_cond = FALSE;
- ctx->b.saved_render_cond_mode = 0;
- if (ctx->b.current_render_cond) {
- ctx->b.saved_render_cond = ctx->b.current_render_cond;
- ctx->b.saved_render_cond_cond = ctx->b.current_render_cond_cond;
- ctx->b.saved_render_cond_mode = ctx->b.current_render_cond_mode;
- ctx->b.b.render_condition(&ctx->b.b, NULL, FALSE, 0);
- }
-
- /* suspend queries */
- ctx->b.nontimer_queries_suspended = false;
- if (ctx->b.num_cs_dw_nontimer_queries_suspend) {
- r600_suspend_nontimer_queries(&ctx->b);
- ctx->b.nontimer_queries_suspended = true;
- }
-
- ctx->b.streamout.suspended = false;
-
- if (ctx->b.streamout.begin_emitted) {
- r600_emit_streamout_end(&ctx->b);
- ctx->b.streamout.suspended = true;
- }
+ r600_preflush_suspend_features(&ctx->b);
ctx->b.flags |= R600_CONTEXT_FLUSH_AND_INV_CB |
R600_CONTEXT_FLUSH_AND_INV_CB_META |
@@ -182,27 +159,12 @@ void si_begin_new_cs(struct si_context *ctx)
si_pm4_emit(ctx, ctx->queued.named.init);
ctx->emitted.named.init = ctx->queued.named.init;
- if (ctx->b.streamout.suspended) {
- ctx->b.streamout.append_bitmask = ctx->b.streamout.enabled_mask;
- r600_streamout_buffers_dirty(&ctx->b);
- }
-
- /* resume queries */
- if (ctx->b.nontimer_queries_suspended) {
- r600_resume_nontimer_queries(&ctx->b);
- }
-
- /* Re-enable render condition. */
- if (ctx->b.saved_render_cond) {
- ctx->b.b.render_condition(&ctx->b.b, ctx->b.saved_render_cond,
- ctx->b.saved_render_cond_cond,
- ctx->b.saved_render_cond_mode);
- }
-
ctx->framebuffer.atom.dirty = true;
ctx->b.streamout.enable_atom.dirty = true;
si_all_descriptors_begin_new_cs(ctx);
+ r600_postflush_resume_features(&ctx->b);
+
ctx->b.initial_gfx_cs_size = ctx->b.rings.gfx.cs->cdw;
}