Patchwork pxa2xx_lcd: SRAM is valid location for the framebuffer

login
register
mail settings
Submitter Vasily Khoruzhick
Date Jan. 24, 2012, 6:49 p.m.
Message ID <1327430953-17699-1-git-send-email-anarsoul@gmail.com>
Download mbox | patch
Permalink /patch/137610/
State New
Headers show

Comments

Vasily Khoruzhick - Jan. 24, 2012, 6:49 p.m.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 hw/pxa2xx_lcd.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
Vasily Khoruzhick - Jan. 24, 2012, 7:25 p.m.
On Tue, 2012-01-24 at 21:49 +0300, Vasily Khoruzhick wrote:
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

Please ignore it, this version is buggy

>  hw/pxa2xx_lcd.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/pxa2xx_lcd.c b/hw/pxa2xx_lcd.c
> index 4e9f7b4..b39abbb 100644
> --- a/hw/pxa2xx_lcd.c
> +++ b/hw/pxa2xx_lcd.c
> @@ -311,6 +311,10 @@ static void pxa2xx_descriptor_load(PXA2xxLCDState *s)
>          if (!(descptr >= PXA2XX_SDRAM_BASE && descptr +
>                      sizeof(desc) <= PXA2XX_SDRAM_BASE + ram_size))
>              continue;
> +        if (!(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 +834,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;
>              }

Patch

diff --git a/hw/pxa2xx_lcd.c b/hw/pxa2xx_lcd.c
index 4e9f7b4..b39abbb 100644
--- a/hw/pxa2xx_lcd.c
+++ b/hw/pxa2xx_lcd.c
@@ -311,6 +311,10 @@  static void pxa2xx_descriptor_load(PXA2xxLCDState *s)
         if (!(descptr >= PXA2XX_SDRAM_BASE && descptr +
                     sizeof(desc) <= PXA2XX_SDRAM_BASE + ram_size))
             continue;
+        if (!(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 +834,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;
             }