WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH 2/2] ioemu: initialize vram area to 0xff

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 2/2] ioemu: initialize vram area to 0xff
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 15 Jan 2009 21:24:55 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx, ian.jackson@xxxxxxxxxxxxx, stefano.stabellini@xxxxxxxxxxxxx
Delivery-date: Thu, 15 Jan 2009 04:24:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
commit 508db40e2c8714a43016a77b7bc32a5fe15577a9
Author: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date:   Thu Jan 15 21:23:12 2009 +0900

    vga: initialize vram area to 0xff
    
    Initialize vram memory in xen_vga_populate_vram().
    and some fixes.
    
    Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index f2ec05b..e1a416b 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3167,8 +3167,9 @@ static int cirrus_vga_load(QEMUFile *f, void *opaque, int 
version_id)
          * ourselves */
         s->vram_gmfn = vga_acc ? s->lfb_addr : VRAM_RESERVED_ADDRESS;
         xen_vga_populate_vram(s->vram_gmfn, s->vram_size);
+    } else {
+        xen_vga_vram_map(s->vram_gmfn, s->vram_size);
     }
-    xen_vga_vram_map(s->vram_gmfn, s->vram_size);
     if (version_id < 3 || (!vga_acc && !t))
         qemu_get_buffer(f, s->vram_ptr, s->vram_size);
 
diff --git a/hw/vga.c b/hw/vga.c
index 2ae6e85..4c3b57e 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2251,7 +2251,6 @@ static int vga_load(QEMUFile *f, void *opaque, int 
version_id)
         /* Old guest, VRAM is not mapped, we have to restore it ourselves */
         if (!s->vram_gmfn) {
             xen_vga_populate_vram(VRAM_RESERVED_ADDRESS, s->vram_size);
-            xen_vga_vram_map(VRAM_RESERVED_ADDRESS, s->vram_size);
             s->vram_gmfn = VRAM_RESERVED_ADDRESS;
             qemu_get_buffer(f, s->vram_ptr, s->vram_size); 
         }
@@ -2447,6 +2446,12 @@ void xen_vga_populate_vram(uint64_t vram_addr, uint32_t 
vga_ram_size)
         exit(1);
     }
     free(pfn_list);
+
+    xen_vga_vram_map(vram_addr, vga_ram_size);
+
+    /* Win2K seems to assume that the pattern buffer is at 0xff
+       initially ! */
+    memset(xen_vga_state->vram_ptr, 0xff, vga_ram_size);
 }
 
 /* Mapping the video memory from GPFN space  */
@@ -2482,6 +2487,10 @@ void xen_vga_vram_map(uint64_t vram_addr, uint32_t 
vga_ram_size)
 #ifdef CONFIG_STUBDOM
     xenfb_pv_display_start(vram);
 #endif
+    /* If some display is already working, we need to update it now */
+    ds= xen_vga_state->ds;
+    if (ds)
+        dpy_update(ds, 0,0, ds->width,ds->height);
 }
 
 /* when used on xen environment, the vga_ram_base is not used */
@@ -2526,7 +2535,6 @@ void vga_common_init(VGAState *s, DisplayState *ds, 
uint8_t *vga_ram_base,
 
     if (!restore) {
         xen_vga_populate_vram(VRAM_RESERVED_ADDRESS, s->vram_size);
-        xen_vga_vram_map(VRAM_RESERVED_ADDRESS, s->vram_size);
         s->vram_gmfn = VRAM_RESERVED_ADDRESS;
     }
 


-- 
yamahata

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel