diff options
author | Marek Olšák <[email protected]> | 2014-04-12 17:01:52 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-04-16 14:02:51 +0200 |
commit | 70cf6639c331342619e65c46db925d115bf51920 (patch) | |
tree | b20b53d7d4d123cd0b7aeb95c3f6eb04243a70f2 /src/gallium/drivers/radeon | |
parent | 3e9d2cbca2b6b65f302adeadbfc049cc51c14c46 (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/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_buffer_common.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_cs.h | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_uvd.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vce.c | 5 |
6 files changed, 17 insertions, 14 deletions
diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c index 77e1b35862a..805756f6cf1 100644 --- a/src/gallium/drivers/radeon/r600_buffer_common.c +++ b/src/gallium/drivers/radeon/r600_buffer_common.c @@ -37,7 +37,7 @@ boolean r600_rings_is_buffer_referenced(struct r600_common_context *ctx, if (ctx->ws->cs_is_buffer_referenced(ctx->rings.gfx.cs, buf, usage)) { return TRUE; } - if (ctx->rings.dma.cs && + if (ctx->rings.dma.cs && ctx->rings.dma.cs->cdw && ctx->ws->cs_is_buffer_referenced(ctx->rings.dma.cs, buf, usage)) { return TRUE; } @@ -64,10 +64,10 @@ void *r600_buffer_map_sync_with_rings(struct r600_common_context *ctx, ctx->ws->cs_is_buffer_referenced(ctx->rings.gfx.cs, resource->cs_buf, rusage)) { if (usage & PIPE_TRANSFER_DONTBLOCK) { - ctx->rings.gfx.flush(ctx, RADEON_FLUSH_ASYNC); + ctx->rings.gfx.flush(ctx, RADEON_FLUSH_ASYNC, NULL); return NULL; } else { - ctx->rings.gfx.flush(ctx, 0); + ctx->rings.gfx.flush(ctx, 0, NULL); busy = true; } } @@ -76,10 +76,10 @@ void *r600_buffer_map_sync_with_rings(struct r600_common_context *ctx, ctx->ws->cs_is_buffer_referenced(ctx->rings.dma.cs, resource->cs_buf, rusage)) { if (usage & PIPE_TRANSFER_DONTBLOCK) { - ctx->rings.dma.flush(ctx, RADEON_FLUSH_ASYNC); + ctx->rings.dma.flush(ctx, RADEON_FLUSH_ASYNC, NULL); return NULL; } else { - ctx->rings.dma.flush(ctx, 0); + ctx->rings.dma.flush(ctx, 0, NULL); busy = true; } } diff --git a/src/gallium/drivers/radeon/r600_cs.h b/src/gallium/drivers/radeon/r600_cs.h index 5588592eb02..b30b465ed41 100644 --- a/src/gallium/drivers/radeon/r600_cs.h +++ b/src/gallium/drivers/radeon/r600_cs.h @@ -57,11 +57,11 @@ static INLINE unsigned r600_context_bo_reloc(struct r600_common_context *rctx, if (ring == &rctx->rings.gfx) { if (rctx->rings.dma.cs) { /* flush dma ring */ - rctx->rings.dma.flush(rctx, RADEON_FLUSH_ASYNC); + rctx->rings.dma.flush(rctx, RADEON_FLUSH_ASYNC, NULL); } } else { /* flush gfx ring */ - rctx->rings.gfx.flush(rctx, RADEON_FLUSH_ASYNC); + rctx->rings.gfx.flush(rctx, RADEON_FLUSH_ASYNC, NULL); } } return rctx->ws->cs_add_reloc(ring->cs, rbo->cs_buf, usage, diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 92f43deba54..bc4838842c1 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -45,7 +45,7 @@ void r600_need_dma_space(struct r600_common_context *ctx, unsigned num_dw) num_dw += ctx->rings.dma.cs->cdw; /* Flush if there's not enough space. */ if (num_dw > RADEON_MAX_CMDBUF_DWORDS) { - ctx->rings.dma.flush(ctx, RADEON_FLUSH_ASYNC); + ctx->rings.dma.flush(ctx, RADEON_FLUSH_ASYNC, NULL); } } @@ -53,7 +53,8 @@ static void r600_memory_barrier(struct pipe_context *ctx, unsigned flags) { } -static void r600_flush_dma_ring(void *ctx, unsigned flags) +static void r600_flush_dma_ring(void *ctx, unsigned flags, + struct pipe_fence_handle **fence) { struct r600_common_context *rctx = (struct r600_common_context *)ctx; struct radeon_winsys_cs *cs = rctx->rings.dma.cs; @@ -63,7 +64,7 @@ static void r600_flush_dma_ring(void *ctx, unsigned flags) } rctx->rings.dma.flushing = true; - rctx->ws->cs_flush(cs, flags, 0); + rctx->ws->cs_flush(cs, flags, fence, 0); rctx->rings.dma.flushing = false; } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 2be9ea280ba..36a4fb1f6aa 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -297,7 +297,8 @@ struct r600_streamout { struct r600_ring { struct radeon_winsys_cs *cs; bool flushing; - void (*flush)(void *ctx, unsigned flags); + void (*flush)(void *ctx, unsigned flags, + struct pipe_fence_handle **fence); }; struct r600_rings { diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c index 88573c1a941..137c69cd157 100644 --- a/src/gallium/drivers/radeon/radeon_uvd.c +++ b/src/gallium/drivers/radeon/radeon_uvd.c @@ -87,7 +87,7 @@ struct ruvd_decoder { /* flush IB to the hardware */ static void flush(struct ruvd_decoder *dec) { - dec->ws->cs_flush(dec->cs, RADEON_FLUSH_ASYNC, 0); + dec->ws->cs_flush(dec->cs, RADEON_FLUSH_ASYNC, NULL, 0); } /* add a new set register command to the IB */ diff --git a/src/gallium/drivers/radeon/radeon_vce.c b/src/gallium/drivers/radeon/radeon_vce.c index 5778dd1b3bf..222f32e1ba0 100644 --- a/src/gallium/drivers/radeon/radeon_vce.c +++ b/src/gallium/drivers/radeon/radeon_vce.c @@ -50,7 +50,7 @@ */ static void flush(struct rvce_encoder *enc) { - enc->ws->cs_flush(enc->cs, RADEON_FLUSH_ASYNC, 0); + enc->ws->cs_flush(enc->cs, RADEON_FLUSH_ASYNC, NULL, 0); } #if 0 @@ -267,7 +267,8 @@ static void rvce_flush(struct pipe_video_codec *encoder) { } -static void rvce_cs_flush(void *ctx, unsigned flags) +static void rvce_cs_flush(void *ctx, unsigned flags, + struct pipe_fence_handle **fence) { // just ignored } |