aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-04-12 17:01:52 +0200
committerMarek Olšák <[email protected]>2014-04-16 14:02:51 +0200
commit70cf6639c331342619e65c46db925d115bf51920 (patch)
treeb20b53d7d4d123cd0b7aeb95c3f6eb04243a70f2 /src/gallium/drivers/radeonsi
parent3e9d2cbca2b6b65f302adeadbfc049cc51c14c46 (diff)
gallium/radeon: create and return a fence in the flush function
All flush functions get a fence parameter. cs_create_fence is removed. Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_hw_context.c7
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c19
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h7
3 files changed, 14 insertions, 19 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
index c952c8d31f7..f5277816382 100644
--- a/src/gallium/drivers/radeonsi/si_hw_context.c
+++ b/src/gallium/drivers/radeonsi/si_hw_context.c
@@ -73,11 +73,12 @@ void si_need_cs_space(struct si_context *ctx, unsigned num_dw,
/* Flush if there's not enough space. */
if (num_dw > RADEON_MAX_CMDBUF_DWORDS) {
- si_flush(&ctx->b.b, NULL, RADEON_FLUSH_ASYNC);
+ ctx->b.rings.gfx.flush(ctx, RADEON_FLUSH_ASYNC, NULL);
}
}
-void si_context_flush(struct si_context *ctx, unsigned flags)
+void si_context_flush(struct si_context *ctx, unsigned flags,
+ struct pipe_fence_handle **fence)
{
struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs;
@@ -123,7 +124,7 @@ void si_context_flush(struct si_context *ctx, unsigned flags)
#endif
/* Flush the CS. */
- ctx->b.ws->cs_flush(ctx->b.rings.gfx.cs, flags, 0);
+ ctx->b.ws->cs_flush(cs, flags, fence, 0);
#if SI_TRACE_CS
if (ctx->screen->b.trace_bo) {
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index bd7670d07be..d434064b572 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -33,18 +33,14 @@
/*
* pipe_context
*/
-void si_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
- unsigned flags)
+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;
- if (fence) {
- *fence = sctx->b.ws->cs_create_fence(sctx->b.rings.gfx.cs);
- }
-
/* Disable render condition. */
if (sctx->b.current_render_cond) {
render_cond = sctx->b.current_render_cond;
@@ -53,7 +49,7 @@ void si_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
ctx->render_condition(ctx, NULL, FALSE, 0);
}
- si_context_flush(sctx, flags);
+ si_context_flush(sctx, flags, fence);
/* Re-enable render condition. */
if (render_cond) {
@@ -72,15 +68,16 @@ static void si_flush_from_st(struct pipe_context *ctx,
rflags |= RADEON_FLUSH_END_OF_FRAME;
if (sctx->b.rings.dma.cs) {
- sctx->b.rings.dma.flush(sctx, rflags);
+ sctx->b.rings.dma.flush(sctx, rflags, NULL);
}
- si_flush(ctx, fence, rflags);
+ si_flush(ctx, rflags, fence);
}
-static void si_flush_gfx_ring(void *ctx, unsigned flags)
+static void si_flush_gfx_ring(void *ctx, unsigned flags,
+ struct pipe_fence_handle **fence)
{
- si_flush((struct pipe_context*)ctx, NULL, flags);
+ si_flush(ctx, flags, fence);
}
static void si_destroy_context(struct pipe_context *context)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index f1ef2ac9469..8930f2becb8 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -177,14 +177,11 @@ 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);
+void si_context_flush(struct si_context *ctx, 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);
-/* si_pipe.c */
-void si_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
- unsigned flags);
-
#if SI_TRACE_CS
void si_trace_emit(struct si_context *sctx);
#endif