This also removes si_flush_gfx_ring.
Reviewed-by: Christian König <christian.koenig@amd.com>
unsigned current_render_cond_mode;
boolean current_render_cond_cond;
boolean predicate_drawing;
+ /* For context flushing. */
+ struct pipe_query *saved_render_cond;
+ boolean saved_render_cond_cond;
+ unsigned saved_render_cond_mode;
/* Copy one resource to another using async DMA. */
void (*dma_copy)(struct pipe_context *ctx,
}
}
-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) {
/* 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) {
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);
/*
* 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)
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)
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);
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);