From 9680a7548951296e9657561cb421d8efea66c5db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 10 Feb 2017 01:40:13 +0100 Subject: [PATCH] radeonsi/gfx9: enable SDMA buffer copying & clearing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/cik_sdma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/cik_sdma.c b/src/gallium/drivers/radeonsi/cik_sdma.c index fdcf22f6d49..500afb07c0b 100644 --- a/src/gallium/drivers/radeonsi/cik_sdma.c +++ b/src/gallium/drivers/radeonsi/cik_sdma.c @@ -57,7 +57,7 @@ static void cik_sdma_copy_buffer(struct si_context *ctx, radeon_emit(cs, CIK_SDMA_PACKET(CIK_SDMA_OPCODE_COPY, CIK_SDMA_COPY_SUB_OPCODE_LINEAR, 0)); - radeon_emit(cs, csize); + radeon_emit(cs, ctx->b.chip_class >= GFX9 ? csize - 1 : csize); radeon_emit(cs, 0); /* src/dst endian swap */ radeon_emit(cs, src_offset); radeon_emit(cs, src_offset >> 32); @@ -103,7 +103,7 @@ static void cik_sdma_clear_buffer(struct pipe_context *ctx, radeon_emit(cs, offset); radeon_emit(cs, offset >> 32); radeon_emit(cs, clear_value); - radeon_emit(cs, csize); + radeon_emit(cs, sctx->b.chip_class >= GFX9 ? csize - 1 : csize); offset += csize; size -= csize; } @@ -534,7 +534,8 @@ static void cik_sdma_copy(struct pipe_context *ctx, return; } - if (cik_sdma_copy_texture(sctx, dst, dst_level, dstx, dsty, dstz, + if ((sctx->b.chip_class == CIK || sctx->b.chip_class == VI) && + cik_sdma_copy_texture(sctx, dst, dst_level, dstx, dsty, dstz, src, src_level, src_box)) return; -- 2.30.2