diff options
author | Marek Olšák <[email protected]> | 2018-04-01 15:37:11 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-04-05 15:34:58 -0400 |
commit | 71d9028b7a746c7744c2fe2d0d7847718d6ca4f9 (patch) | |
tree | ff746cdb907d69e4b2ec47ad431ce6b9a5465779 /src/gallium/drivers/radeon | |
parent | 0606190059f58da724973b684559db4a8b708638 (diff) |
radeonsi: use r600_common_context less pt1
Acked-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_buffer_common.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 22 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c index 3789bccd6d4..8a4ad2dc6db 100644 --- a/src/gallium/drivers/radeon/r600_buffer_common.c +++ b/src/gallium/drivers/radeon/r600_buffer_common.c @@ -46,6 +46,7 @@ void *si_buffer_map_sync_with_rings(struct r600_common_context *ctx, struct r600_resource *resource, unsigned usage) { + struct si_context *sctx = (struct si_context*)ctx; enum radeon_bo_usage rusage = RADEON_USAGE_READWRITE; bool busy = false; @@ -75,10 +76,10 @@ void *si_buffer_map_sync_with_rings(struct r600_common_context *ctx, ctx->ws->cs_is_buffer_referenced(ctx->dma_cs, resource->buf, rusage)) { if (usage & PIPE_TRANSFER_DONTBLOCK) { - si_flush_dma_cs(ctx, PIPE_FLUSH_ASYNC, NULL); + si_flush_dma_cs(sctx, PIPE_FLUSH_ASYNC, NULL); return NULL; } else { - si_flush_dma_cs(ctx, 0, NULL); + si_flush_dma_cs(sctx, 0, NULL); busy = true; } } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index afea9484a24..0db88729dcc 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -79,7 +79,7 @@ static bool r600_resource_commit(struct pipe_context *pctx, unsigned level, struct pipe_box *box, bool commit) { - struct r600_common_context *ctx = (struct r600_common_context *)pctx; + struct si_context *ctx = (struct si_context *)pctx; struct r600_resource *res = r600_resource(resource); /* @@ -89,23 +89,23 @@ static bool r600_resource_commit(struct pipe_context *pctx, * (b) wait for threaded submit to finish, including those that were * triggered by some other, earlier operation. */ - if (radeon_emitted(ctx->gfx_cs, ctx->initial_gfx_cs_size) && - ctx->ws->cs_is_buffer_referenced(ctx->gfx_cs, - res->buf, RADEON_USAGE_READWRITE)) { + if (radeon_emitted(ctx->b.gfx_cs, ctx->b.initial_gfx_cs_size) && + ctx->b.ws->cs_is_buffer_referenced(ctx->b.gfx_cs, + res->buf, RADEON_USAGE_READWRITE)) { si_flush_gfx_cs(ctx, PIPE_FLUSH_ASYNC, NULL); } - if (radeon_emitted(ctx->dma_cs, 0) && - ctx->ws->cs_is_buffer_referenced(ctx->dma_cs, - res->buf, RADEON_USAGE_READWRITE)) { + if (radeon_emitted(ctx->b.dma_cs, 0) && + ctx->b.ws->cs_is_buffer_referenced(ctx->b.dma_cs, + res->buf, RADEON_USAGE_READWRITE)) { si_flush_dma_cs(ctx, PIPE_FLUSH_ASYNC, NULL); } - ctx->ws->cs_sync_flush(ctx->dma_cs); - ctx->ws->cs_sync_flush(ctx->gfx_cs); + ctx->b.ws->cs_sync_flush(ctx->b.dma_cs); + ctx->b.ws->cs_sync_flush(ctx->b.gfx_cs); assert(resource->target == PIPE_BUFFER); - return ctx->ws->buffer_commit(res->buf, box->x, box->width, commit); + return ctx->b.ws->buffer_commit(res->buf, box->x, box->width, commit); } bool si_common_context_init(struct r600_common_context *rctx, @@ -175,7 +175,7 @@ bool si_common_context_init(struct r600_common_context *rctx, if (sscreen->info.num_sdma_rings && !(sscreen->debug_flags & DBG(NO_ASYNC_DMA))) { rctx->dma_cs = rctx->ws->cs_create(rctx->ctx, RING_DMA, - si_flush_dma_cs, + (void*)si_flush_dma_cs, rctx); } |