diff options
author | Marek Olšák <[email protected]> | 2018-08-24 00:04:11 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-09-10 15:19:56 -0400 |
commit | 1119fe5c25db7ae6d5bf7480a3277f5ce91097f6 (patch) | |
tree | 84d63324799040cce47b83baa07eba355d026a66 /src/gallium/drivers/radeonsi/cik_sdma.c | |
parent | be0bd95abf69920fc11fb50384ffc2f886a5f9e8 (diff) |
radeonsi: merge SI and CI dma_clear_buffer and remove the callback
also use assertions for the requirements that offset and size are a multiple
of 4.
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/cik_sdma.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/cik_sdma.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/gallium/drivers/radeonsi/cik_sdma.c b/src/gallium/drivers/radeonsi/cik_sdma.c index 595f8d49a80..1c2fd0f7b1c 100644 --- a/src/gallium/drivers/radeonsi/cik_sdma.c +++ b/src/gallium/drivers/radeonsi/cik_sdma.c @@ -67,46 +67,6 @@ static void cik_sdma_copy_buffer(struct si_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 radeon_cmdbuf *cs = sctx->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) { - sctx->b.clear_buffer(&sctx->b, dst, offset, size, &clear_value, 4); - return; - } - - /* Mark the buffer range of destination as valid (initialized), - * so that transfer_map knows it should wait for the GPU when mapping - * that range. */ - util_range_add(&rdst->valid_buffer_range, offset, offset + size); - - offset += rdst->gpu_address; - - /* the same maximum size as for copying */ - ncopy = DIV_ROUND_UP(size, CIK_SDMA_COPY_MAX_SIZE); - si_need_dma_space(sctx, ncopy * 5, rdst, NULL); - - for (i = 0; i < ncopy; i++) { - csize = MIN2(size, CIK_SDMA_COPY_MAX_SIZE); - radeon_emit(cs, CIK_SDMA_PACKET(CIK_SDMA_PACKET_CONSTANT_FILL, 0, - 0x8000 /* dword copy */)); - radeon_emit(cs, offset); - radeon_emit(cs, offset >> 32); - radeon_emit(cs, clear_value); - radeon_emit(cs, sctx->chip_class >= GFX9 ? csize - 1 : csize); - offset += csize; - size -= csize; - } -} - static unsigned minify_as_blocks(unsigned width, unsigned level, unsigned blk_w) { width = u_minify(width, level); @@ -554,5 +514,4 @@ fallback: void cik_init_sdma_functions(struct si_context *sctx) { sctx->dma_copy = cik_sdma_copy; - sctx->dma_clear_buffer = cik_sdma_clear_buffer; } |