From 773cd197a323d2f9b701addd63e30d54e43c74f5 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Thu, 20 Apr 2023 11:37:34 +0200 Subject: Add optional DMA usage on flipbuf This will copy an entire row of tiles instead of per tile copy, but for applications that clear the screen on each frame it will be more efficient. --- src/common.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/common.h') diff --git a/src/common.h b/src/common.h index e62c78c..1fbfa4c 100644 --- a/src/common.h +++ b/src/common.h @@ -419,12 +419,16 @@ dma_transfer_fill(void *dst, volatile u32 src, u32 count, int channel, u32 optio inline void dma_copy(void *dst, const void *src, u32 size, int channel) { dma_transfer_copy(dst, src, size / 4, channel, DMA_CHUNK_32 | DMA_ENABLE); + // Stall for 2 cycles in case we call this function more than once. + asm("nop"); asm("nop"); } // Fill the dst location with the word set at src. inline void dma_fill(void *dst, vu32 src, u32 size, int channel) { dma_transfer_fill(dst, src, size / 4, channel, DMA_CHUNK_32 | DMA_ENABLE); + // Stall for 2 cycles in case we call this function more than once. + asm("nop"); asm("nop"); } // -- cgit v1.2.1