diff options
author | Marek Olšák <[email protected]> | 2018-04-01 17:08:35 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-04-05 15:34:58 -0400 |
commit | e332ba61f40bc77d3104bd060bc7d1b18edd7e95 (patch) | |
tree | cbb8b86ddc3a119251cc97993491587e89d01188 /src/gallium/drivers/radeonsi | |
parent | c424f86180d8c0c2c0e6b18b34564c5dc0c53942 (diff) |
radeonsi: use si_context instead of pipe_context in parameters pt2
Acked-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/cik_sdma.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_clear.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_cp_dma.c | 9 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_dma.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_dma_cs.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_test_dma.c | 2 |
9 files changed, 18 insertions, 21 deletions
diff --git a/src/gallium/drivers/radeonsi/cik_sdma.c b/src/gallium/drivers/radeonsi/cik_sdma.c index 05a5ce372df..8aaf489936f 100644 --- a/src/gallium/drivers/radeonsi/cik_sdma.c +++ b/src/gallium/drivers/radeonsi/cik_sdma.c @@ -67,20 +67,19 @@ static void cik_sdma_copy_buffer(struct si_context *ctx, } } -static void cik_sdma_clear_buffer(struct pipe_context *ctx, +static void cik_sdma_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_t offset, uint64_t size, unsigned clear_value) { - struct si_context *sctx = (struct si_context *)ctx; struct radeon_winsys_cs *cs = sctx->b.dma_cs; unsigned i, ncopy, csize; struct r600_resource *rdst = r600_resource(dst); if (!cs || offset % 4 != 0 || size % 4 != 0 || dst->flags & PIPE_RESOURCE_FLAG_SPARSE) { - ctx->clear_buffer(ctx, dst, offset, size, &clear_value, 4); + sctx->b.b.clear_buffer(&sctx->b.b, dst, offset, size, &clear_value, 4); return; } diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c index c13e98b4b32..8198ffb8812 100644 --- a/src/gallium/drivers/radeonsi/si_clear.c +++ b/src/gallium/drivers/radeonsi/si_clear.c @@ -230,7 +230,7 @@ void vi_dcc_clear_level(struct si_context *sctx, num_layers; } - si_clear_buffer(&sctx->b.b, dcc_buffer, dcc_offset, clear_size, + si_clear_buffer(sctx, dcc_buffer, dcc_offset, clear_size, clear_value, R600_COHERENCY_CB_META); } @@ -459,7 +459,7 @@ static void si_do_fast_color_clear(struct si_context *sctx, if (clear_words_needed) continue; - si_clear_buffer(&sctx->b.b, &tex->cmask_buffer->b.b, + si_clear_buffer(sctx, &tex->cmask_buffer->b.b, tex->cmask.offset, tex->cmask.size, 0xCCCCCCCC, R600_COHERENCY_CB_META); need_decompress_pass = true; @@ -491,7 +491,7 @@ static void si_do_fast_color_clear(struct si_context *sctx, } /* Do the fast clear. */ - si_clear_buffer(&sctx->b.b, &tex->cmask_buffer->b.b, + si_clear_buffer(sctx, &tex->cmask_buffer->b.b, tex->cmask.offset, tex->cmask.size, 0, R600_COHERENCY_CB_META); need_decompress_pass = true; diff --git a/src/gallium/drivers/radeonsi/si_cp_dma.c b/src/gallium/drivers/radeonsi/si_cp_dma.c index 7e3d825aca4..17e15d13744 100644 --- a/src/gallium/drivers/radeonsi/si_cp_dma.c +++ b/src/gallium/drivers/radeonsi/si_cp_dma.c @@ -204,11 +204,10 @@ static void si_cp_dma_prepare(struct si_context *sctx, struct pipe_resource *dst *packet_flags |= CP_DMA_SYNC; } -void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst, +void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_t offset, uint64_t size, unsigned value, enum r600_coherency coher) { - struct si_context *sctx = (struct si_context*)ctx; struct radeon_winsys *ws = sctx->b.ws; struct r600_resource *rdst = r600_resource(dst); unsigned tc_l2_flag = get_tc_l2_flag(sctx, coher); @@ -243,7 +242,7 @@ void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst, * of them are moved to SDMA thanks to this. */ !ws->cs_is_buffer_referenced(sctx->b.gfx_cs, rdst->buf, RADEON_USAGE_READWRITE))) { - sctx->b.dma_clear_buffer(ctx, dst, offset, dma_clear_size, value); + sctx->b.dma_clear_buffer(sctx, dst, offset, dma_clear_size, value); offset += dma_clear_size; size -= dma_clear_size; @@ -287,7 +286,7 @@ void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst, assert(dst->target == PIPE_BUFFER); assert(size < 4); - pipe_buffer_write(ctx, dst, offset, size, &value); + pipe_buffer_write(&sctx->b.b, dst, offset, size, &value); } } @@ -347,7 +346,7 @@ static void si_pipe_clear_buffer(struct pipe_context *ctx, dword_value = *(uint32_t*)clear_value_ptr; } - si_clear_buffer(ctx, dst, offset, size, dword_value, + si_clear_buffer(sctx, dst, offset, size, dword_value, R600_COHERENCY_SHADER); } diff --git a/src/gallium/drivers/radeonsi/si_dma.c b/src/gallium/drivers/radeonsi/si_dma.c index 12c8459c0b3..106fbd544cf 100644 --- a/src/gallium/drivers/radeonsi/si_dma.c +++ b/src/gallium/drivers/radeonsi/si_dma.c @@ -77,20 +77,19 @@ static void si_dma_copy_buffer(struct si_context *ctx, } } -static void si_dma_clear_buffer(struct pipe_context *ctx, +static void si_dma_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_t offset, uint64_t size, unsigned clear_value) { - struct si_context *sctx = (struct si_context *)ctx; struct radeon_winsys_cs *cs = sctx->b.dma_cs; unsigned i, ncopy, csize; struct r600_resource *rdst = r600_resource(dst); if (!cs || offset % 4 != 0 || size % 4 != 0 || dst->flags & PIPE_RESOURCE_FLAG_SPARSE) { - ctx->clear_buffer(ctx, dst, offset, size, &clear_value, 4); + sctx->b.b.clear_buffer(&sctx->b.b, dst, offset, size, &clear_value, 4); return; } diff --git a/src/gallium/drivers/radeonsi/si_dma_cs.c b/src/gallium/drivers/radeonsi/si_dma_cs.c index 3fe8ddf6189..fbe88acd187 100644 --- a/src/gallium/drivers/radeonsi/si_dma_cs.c +++ b/src/gallium/drivers/radeonsi/si_dma_cs.c @@ -144,7 +144,7 @@ void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst struct si_context *ctx = (struct si_context*)sscreen->aux_context; mtx_lock(&sscreen->aux_context_lock); - ctx->b.dma_clear_buffer(&ctx->b.b, dst, offset, size, value); + ctx->b.dma_clear_buffer(ctx, dst, offset, size, value); sscreen->aux_context->flush(sscreen->aux_context, NULL, 0); mtx_unlock(&sscreen->aux_context_lock); } diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index d8e4be79256..06d5642d1c4 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -383,7 +383,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, &sctx->null_const_buf); /* Clear the NULL constant buffer, because loads should return zeros. */ - si_clear_buffer(&sctx->b.b, sctx->null_const_buf.buffer, 0, + si_clear_buffer(sctx, sctx->null_const_buf.buffer, 0, sctx->null_const_buf.buffer->width0, 0, R600_COHERENCY_SHADER); } @@ -602,7 +602,7 @@ static void si_test_vmfault(struct si_screen *sscreen) puts("VM fault test: CP - done."); } if (sscreen->debug_flags & DBG(TEST_VMFAULT_SDMA)) { - sctx->b.dma_clear_buffer(ctx, buf, 0, 4, 0); + sctx->b.dma_clear_buffer(sctx, buf, 0, 4, 0); ctx->flush(ctx, NULL, 0); puts("VM fault test: SDMA - done."); } diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index f0dc8a03bde..72330b9f779 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -694,7 +694,7 @@ enum r600_coherency { R600_COHERENCY_CB_META, }; -void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst, +void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_t offset, uint64_t size, unsigned value, enum r600_coherency coher); void si_copy_buffer(struct si_context *sctx, diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 20a8adc3b90..acba6c6660b 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2732,7 +2732,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx, rtex = (struct r600_texture*)sctx->framebuffer.state.cbufs[i]->texture; if (rtex->dcc_gather_statistics) - vi_separate_dcc_stop_query(ctx, rtex); + vi_separate_dcc_stop_query(sctx, rtex); } /* Disable DCC if the formats are incompatible. */ @@ -2875,7 +2875,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx, if (rtex->dcc_gather_statistics) { /* Dirty tracking must be enabled for DCC usage analysis. */ sctx->framebuffer.compressed_cb_mask |= 1 << i; - vi_separate_dcc_start_query(ctx, rtex); + vi_separate_dcc_start_query(sctx, rtex); } } diff --git a/src/gallium/drivers/radeonsi/si_test_dma.c b/src/gallium/drivers/radeonsi/si_test_dma.c index bb04d0b6fd2..6cf3d3b5151 100644 --- a/src/gallium/drivers/radeonsi/si_test_dma.c +++ b/src/gallium/drivers/radeonsi/si_test_dma.c @@ -307,7 +307,7 @@ void si_test_dma(struct si_screen *sscreen) set_random_pixels(ctx, src, &src_cpu); /* clear dst pixels */ - si_clear_buffer(ctx, dst, 0, rdst->surface.surf_size, 0, true); + si_clear_buffer(sctx, dst, 0, rdst->surface.surf_size, 0, true); memset(dst_cpu.ptr, 0, dst_cpu.layer_stride * tdst.array_size); /* preparation */ |