From f837c37f022ecf4925a574961027eb12f125e66c Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 26 Apr 2016 19:10:43 +0200 Subject: radeonsi: raise the max size for SDMA buffer copies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Alex Deucher Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/cik_sdma.c | 4 ++-- src/gallium/drivers/radeonsi/sid.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/radeonsi/cik_sdma.c b/src/gallium/drivers/radeonsi/cik_sdma.c index ec3446a5b5f..88a994ee390 100644 --- a/src/gallium/drivers/radeonsi/cik_sdma.c +++ b/src/gallium/drivers/radeonsi/cik_sdma.c @@ -46,7 +46,7 @@ static void cik_sdma_do_copy_buffer(struct si_context *ctx, dst_offset += r600_resource(dst)->gpu_address; src_offset += r600_resource(src)->gpu_address; - ncopy = (size + CIK_SDMA_COPY_MAX_SIZE - 1) / CIK_SDMA_COPY_MAX_SIZE; + ncopy = DIV_ROUND_UP(size, CIK_SDMA_COPY_MAX_SIZE); r600_need_dma_space(&ctx->b, ncopy * 7); radeon_add_to_buffer_list(&ctx->b, &ctx->b.dma, rsrc, RADEON_USAGE_READ, @@ -55,7 +55,7 @@ static void cik_sdma_do_copy_buffer(struct si_context *ctx, RADEON_PRIO_SDMA_BUFFER); for (i = 0; i < ncopy; i++) { - csize = size < CIK_SDMA_COPY_MAX_SIZE ? size : CIK_SDMA_COPY_MAX_SIZE; + csize = MIN2(size, CIK_SDMA_COPY_MAX_SIZE); cs->buf[cs->cdw++] = CIK_SDMA_PACKET(CIK_SDMA_OPCODE_COPY, CIK_SDMA_COPY_SUB_OPCODE_LINEAR, 0); diff --git a/src/gallium/drivers/radeonsi/sid.h b/src/gallium/drivers/radeonsi/sid.h index da4f4fa2ed8..dcd63727058 100644 --- a/src/gallium/drivers/radeonsi/sid.h +++ b/src/gallium/drivers/radeonsi/sid.h @@ -9021,7 +9021,7 @@ #define CIK_SDMA_PACKET_SEMAPHORE 0x7 #define CIK_SDMA_PACKET_CONSTANT_FILL 0xb #define CIK_SDMA_PACKET_SRBM_WRITE 0xe -#define CIK_SDMA_COPY_MAX_SIZE 0x1fffff +#define CIK_SDMA_COPY_MAX_SIZE 0x3fffe0 #endif /* _SID_H */ -- cgit v1.2.3