From: Rene Stange <rsta2@o2online.de>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm <qemu-arm@nongnu.org>,
qemu-devel <qemu-devel@nongnu.org>,
Andrew Baumann <andrew.baumann@microsoft.com>
Subject: [PATCH v2 2/2] bcm2835_dma: Re-initialize xlen in TD mode
Date: Mon, 03 Feb 2020 16:40:51 +0100 [thread overview]
Message-ID: <5397138.k0qeMALlIp@desktop2> (raw)
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(), which has been fixed.
Signed-off-by: Rene Stange <rsta2@o2online.de>
---
hw/dma/bcm2835_dma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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;
--
2.16.4
next reply other threads:[~2020-02-03 17:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 15:40 Rene Stange [this message]
2020-02-03 16:27 ` [PATCH v2 2/2] bcm2835_dma: Re-initialize xlen in TD mode Philippe Mathieu-Daudé
2020-02-03 16:45 ` Rene Stange
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5397138.k0qeMALlIp@desktop2 \
--to=rsta2@o2online.de \
--cc=andrew.baumann@microsoft.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).