summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_cp_dma.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-12-04 21:24:46 +0100
committerMarek Olšák <marek.olsak@amd.com>2015-12-11 15:25:12 +0100
commit7c29bf26bbaa1ead489f3dd35a8458ba58d2195d (patch)
tree634be1b6cf7bb83f80b065125d16b4d8d4d4b4d4 /src/gallium/drivers/radeonsi/si_cp_dma.c
parent787ada6bf65a58b1bab5a30be86698e9b7b0797e (diff)
downloadexternal_mesa3d-7c29bf26bbaa1ead489f3dd35a8458ba58d2195d.zip
external_mesa3d-7c29bf26bbaa1ead489f3dd35a8458ba58d2195d.tar.gz
external_mesa3d-7c29bf26bbaa1ead489f3dd35a8458ba58d2195d.tar.bz2
radeonsi: don't use the CP DMA workaround on Fiji and newer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_cp_dma.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_cp_dma.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/gallium/drivers/radeonsi/si_cp_dma.c b/src/gallium/drivers/radeonsi/si_cp_dma.c
index 0bf85a0..a5e3d79 100644
--- a/src/gallium/drivers/radeonsi/si_cp_dma.c
+++ b/src/gallium/drivers/radeonsi/si_cp_dma.c
@@ -273,22 +273,26 @@ void si_copy_buffer(struct si_context *sctx,
dst_offset += r600_resource(dst)->gpu_address;
src_offset += r600_resource(src)->gpu_address;
- /* If the size is not aligned, we must add a dummy copy at the end
- * just to align the internal counter. Otherwise, the DMA engine
- * would slow down by an order of magnitude for following copies.
- */
- if (size % CP_DMA_ALIGNMENT)
- realign_size = CP_DMA_ALIGNMENT - (size % CP_DMA_ALIGNMENT);
-
- /* If the copy begins unaligned, we must start copying from the next
- * aligned block and the skipped part should be copied after everything
- * else has been copied. Only the src alignment matters, not dst.
- */
- if (src_offset % CP_DMA_ALIGNMENT) {
- skipped_size = CP_DMA_ALIGNMENT - (src_offset % CP_DMA_ALIGNMENT);
- /* The main part will be skipped if the size is too small. */
- skipped_size = MIN2(skipped_size, size);
- size -= skipped_size;
+ /* The workarounds aren't needed on Fiji and beyond. */
+ if (sctx->b.family <= CHIP_CARRIZO ||
+ sctx->b.family == CHIP_STONEY) {
+ /* If the size is not aligned, we must add a dummy copy at the end
+ * just to align the internal counter. Otherwise, the DMA engine
+ * would slow down by an order of magnitude for following copies.
+ */
+ if (size % CP_DMA_ALIGNMENT)
+ realign_size = CP_DMA_ALIGNMENT - (size % CP_DMA_ALIGNMENT);
+
+ /* If the copy begins unaligned, we must start copying from the next
+ * aligned block and the skipped part should be copied after everything
+ * else has been copied. Only the src alignment matters, not dst.
+ */
+ if (src_offset % CP_DMA_ALIGNMENT) {
+ skipped_size = CP_DMA_ALIGNMENT - (src_offset % CP_DMA_ALIGNMENT);
+ /* The main part will be skipped if the size is too small. */
+ skipped_size = MIN2(skipped_size, size);
+ size -= skipped_size;
+ }
}
/* Flush the caches. */