radeonsi/gfx9: enable SDMA buffer copying & clearing
authorMarek Olšák <marek.olsak@amd.com>
Fri, 10 Feb 2017 00:40:13 +0000 (01:40 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 30 Mar 2017 12:44:33 +0000 (14:44 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/cik_sdma.c

index fdcf22f6d4968c54a6698d02c230e8d8f5642425..500afb07c0ba875d313292564d1fb0b67033d81c 100644 (file)
@@ -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;