summaryrefslogtreecommitdiffstats
path: root/hw/dma/bcm2835_dma.c
diff options
context:
space:
mode:
authorRene Stange2020-02-07 15:04:28 +0100
committerPeter Maydell2020-02-07 15:04:28 +0100
commit25437c09d7c46dea4a87dcff6642ce786fe14d28 (patch)
treed781894a545a4e3216873aabeeebe76183c7a844 /hw/dma/bcm2835_dma.c
parentbcm2835_dma: Fix the ylen loop in TD mode (diff)
downloadqemu-25437c09d7c46dea4a87dcff6642ce786fe14d28.tar.gz
qemu-25437c09d7c46dea4a87dcff6642ce786fe14d28.tar.xz
qemu-25437c09d7c46dea4a87dcff6642ce786fe14d28.zip
bcm2835_dma: Re-initialize xlen in TD mode
TD (two dimensions) DMA mode did not work, because the xlen variable has not been re-initialized before each additional ylen run through in bcm2835_dma_update(). Fix it. Signed-off-by: Rene Stange <rsta2@o2online.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/dma/bcm2835_dma.c')
-rw-r--r--hw/dma/bcm2835_dma.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/dma/bcm2835_dma.c b/hw/dma/bcm2835_dma.c
index 667d951a6f..ccff5ed55b 100644
--- a/hw/dma/bcm2835_dma.c
+++ b/hw/dma/bcm2835_dma.c
@@ -54,7 +54,7 @@
static void bcm2835_dma_update(BCM2835DMAState *s, unsigned c)
{
BCM2835DMAChan *ch = &s->chan[c];
- uint32_t data, xlen, ylen;
+ uint32_t data, xlen, xlen_td, ylen;
int16_t dst_stride, src_stride;
if (!(s->enable & (1 << c))) {
@@ -82,6 +82,7 @@ static void bcm2835_dma_update(BCM2835DMAState *s, unsigned c)
dst_stride = 0;
src_stride = 0;
}
+ xlen_td = xlen;
while (ylen != 0) {
/* Normal transfer mode */
@@ -117,6 +118,7 @@ static void bcm2835_dma_update(BCM2835DMAState *s, unsigned c)
if (--ylen != 0) {
ch->source_ad += src_stride;
ch->dest_ad += dst_stride;
+ xlen = xlen_td;
}
}
ch->cs |= BCM2708_DMA_END;