diff options
author | Marek Olšák <marek.olsak@amd.com> | 2014-04-12 17:34:44 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2014-04-16 14:02:51 +0200 |
commit | d4edc607670e37138f7a804ba208cf91acd9d0f1 (patch) | |
tree | 226b9d086b89b369bdd01a2e243bb2114d2cd97e /src/gallium/drivers/radeonsi | |
parent | 70cf6639c331342619e65c46db925d115bf51920 (diff) |
radeonsi: merge si_flush with si_context_flush
This also removes si_flush_gfx_ring.
Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 26 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 37 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 4 |
3 files changed, 29 insertions, 38 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index f5277816382..37ca290291f 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -77,14 +77,28 @@ void si_need_cs_space(struct si_context *ctx, unsigned num_dw, } } -void si_context_flush(struct si_context *ctx, unsigned flags, - struct pipe_fence_handle **fence) +void si_context_gfx_flush(void *context, unsigned flags, + struct pipe_fence_handle **fence) { + struct si_context *ctx = context; struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs; if (cs->cdw == ctx->b.initial_gfx_cs_size) return; + 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) { @@ -125,6 +139,7 @@ void si_context_flush(struct si_context *ctx, unsigned flags, /* Flush the CS. */ ctx->b.ws->cs_flush(cs, flags, fence, 0); + ctx->b.rings.gfx.flushing = false; #if SI_TRACE_CS if (ctx->screen->b.trace_bo) { @@ -177,6 +192,13 @@ void si_begin_new_cs(struct si_context *ctx) 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); diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index d434064b572..7f3b0c22198 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -33,30 +33,6 @@ /* * pipe_context */ -static void si_flush(struct pipe_context *ctx, unsigned flags, - struct pipe_fence_handle **fence) -{ - struct si_context *sctx = (struct si_context *)ctx; - struct pipe_query *render_cond = NULL; - boolean render_cond_cond = FALSE; - unsigned render_cond_mode = 0; - - /* Disable render condition. */ - if (sctx->b.current_render_cond) { - render_cond = sctx->b.current_render_cond; - render_cond_cond = sctx->b.current_render_cond_cond; - render_cond_mode = sctx->b.current_render_cond_mode; - ctx->render_condition(ctx, NULL, FALSE, 0); - } - - si_context_flush(sctx, flags, fence); - - /* Re-enable render condition. */ - if (render_cond) { - ctx->render_condition(ctx, render_cond, render_cond_cond, render_cond_mode); - } -} - static void si_flush_from_st(struct pipe_context *ctx, struct pipe_fence_handle **fence, unsigned flags) @@ -70,14 +46,7 @@ static void si_flush_from_st(struct pipe_context *ctx, if (sctx->b.rings.dma.cs) { sctx->b.rings.dma.flush(sctx, rflags, NULL); } - - si_flush(ctx, rflags, fence); -} - -static void si_flush_gfx_ring(void *ctx, unsigned flags, - struct pipe_fence_handle **fence) -{ - si_flush(ctx, flags, fence); + sctx->b.rings.gfx.flush(sctx, rflags, fence); } static void si_destroy_context(struct pipe_context *context) @@ -145,9 +114,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, void * sctx->b.b.create_video_buffer = vl_video_buffer_create; } - sctx->b.rings.gfx.cs = ws->cs_create(ws, RING_GFX, si_flush_gfx_ring, + sctx->b.rings.gfx.cs = ws->cs_create(ws, RING_GFX, si_context_gfx_flush, sctx, NULL); - sctx->b.rings.gfx.flush = si_flush_gfx_ring; + sctx->b.rings.gfx.flush = si_context_gfx_flush; si_init_all_descriptors(sctx); diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 8930f2becb8..a74bbcf5c61 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -177,8 +177,8 @@ void si_dma_copy(struct pipe_context *ctx, const struct pipe_box *src_box); /* si_hw_context.c */ -void si_context_flush(struct si_context *ctx, unsigned flags, - struct pipe_fence_handle **fence); +void si_context_gfx_flush(void *context, unsigned flags, + struct pipe_fence_handle **fence); void si_begin_new_cs(struct si_context *ctx); void si_need_cs_space(struct si_context *ctx, unsigned num_dw, boolean count_draw_in); |