summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-04-11 21:51:12 +0200
committerMarek Olšák <[email protected]>2014-04-16 14:02:51 +0200
commitc6033a6cb8ae50d5513a00ea249f3df20d221b52 (patch)
treef83f9eec51db4c98479f82fef1d1cdf98b236ab7
parentfc151b08bebe3be2ac491da60f65ed58aa6004a4 (diff)
radeonsi: cleanup redundant computation of flush flags and rename a function
Reviewed-by: Christian König <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 03f73acac83..ec03d6c232c 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -66,17 +66,19 @@ static void si_flush_from_st(struct pipe_context *ctx,
unsigned flags)
{
struct si_context *sctx = (struct si_context *)ctx;
+ unsigned rflags = 0;
+
+ if (flags & PIPE_FLUSH_END_OF_FRAME)
+ rflags |= RADEON_FLUSH_END_OF_FRAME;
if (sctx->b.rings.dma.cs) {
- sctx->b.rings.dma.flush(sctx,
- flags & PIPE_FLUSH_END_OF_FRAME ? RADEON_FLUSH_END_OF_FRAME : 0);
+ sctx->b.rings.dma.flush(sctx, rflags);
}
- si_flush(ctx, fence,
- flags & PIPE_FLUSH_END_OF_FRAME ? RADEON_FLUSH_END_OF_FRAME : 0);
+ si_flush(ctx, fence, rflags);
}
-static void si_flush_from_winsys(void *ctx, unsigned flags)
+static void si_flush_gfx_ring(void *ctx, unsigned flags)
{
si_flush((struct pipe_context*)ctx, NULL, flags);
}
@@ -146,7 +148,8 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, void *
}
sctx->b.rings.gfx.cs = sctx->b.ws->cs_create(sctx->b.ws, RING_GFX, NULL);
- sctx->b.rings.gfx.flush = si_flush_from_winsys;
+ sctx->b.rings.gfx.flush = si_flush_gfx_ring;
+ sctx->b.ws->cs_set_flush_callback(sctx->b.rings.gfx.cs, si_flush_gfx_ring, sctx);
si_init_all_descriptors(sctx);
@@ -168,8 +171,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, void *
goto fail;
}
- sctx->b.ws->cs_set_flush_callback(sctx->b.rings.gfx.cs, si_flush_from_winsys, sctx);
-
sctx->blitter = util_blitter_create(&sctx->b.b);
if (sctx->blitter == NULL)
goto fail;