From: Vasily Khoruzhick <anarsoul@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>,
Andrzej Zaborowski <andrew.zaborowski@intel.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Vasily Khoruzhick <anarsoul@gmail.com>
Subject: [Qemu-devel] [PATCH v2] pxa2xx_lcd: SRAM is valid location for the framebuffer
Date: Tue, 24 Jan 2012 22:32:30 +0300 [thread overview]
Message-ID: <1327433550-20827-1-git-send-email-anarsoul@gmail.com> (raw)
In-Reply-To: <1327433142.17939.0.camel@anarsoul-laptop.lan>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
v2: fix descptr validation
hw/pxa2xx_lcd.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/hw/pxa2xx_lcd.c b/hw/pxa2xx_lcd.c
index 4e9f7b4..de0fa48 100644
--- a/hw/pxa2xx_lcd.c
+++ b/hw/pxa2xx_lcd.c
@@ -308,9 +308,12 @@ static void pxa2xx_descriptor_load(PXA2xxLCDState *s)
} else
descptr = s->dma_ch[i].descriptor;
- if (!(descptr >= PXA2XX_SDRAM_BASE && descptr +
- sizeof(desc) <= PXA2XX_SDRAM_BASE + ram_size))
+ if (!((descptr >= PXA2XX_SDRAM_BASE && descptr +
+ sizeof(desc) <= PXA2XX_SDRAM_BASE + ram_size) ||
+ (descptr >= PXA2XX_INTERNAL_BASE && descptr +
+ sizeof(desc) <= PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) {
continue;
+ }
cpu_physical_memory_read(descptr, (void *)&desc, sizeof(desc));
s->dma_ch[i].descriptor = tswap32(desc.fdaddr);
@@ -830,8 +833,10 @@ static void pxa2xx_update_display(void *opaque)
continue;
}
fbptr = s->dma_ch[ch].source;
- if (!(fbptr >= PXA2XX_SDRAM_BASE &&
- fbptr <= PXA2XX_SDRAM_BASE + ram_size)) {
+ if (!((fbptr >= PXA2XX_SDRAM_BASE &&
+ fbptr <= PXA2XX_SDRAM_BASE + ram_size) ||
+ (fbptr >= PXA2XX_INTERNAL_BASE &&
+ fbptr <= PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) {
pxa2xx_dma_ber_set(s, ch);
continue;
}
--
1.7.8.4
next prev parent reply other threads:[~2012-01-24 19:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 18:49 [Qemu-devel] [PATCH] pxa2xx_lcd: SRAM is valid location for the framebuffer Vasily Khoruzhick
2012-01-24 19:25 ` Vasily Khoruzhick
2012-01-24 19:32 ` Vasily Khoruzhick [this message]
2012-02-17 7:26 ` [Qemu-devel] [PATCH v2] " andrzej zaborowski
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=1327433550-20827-1-git-send-email-anarsoul@gmail.com \
--to=anarsoul@gmail.com \
--cc=andrew.zaborowski@intel.com \
--cc=peter.maydell@linaro.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).