All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-ia64-devel@lists.xensource.com,
	Isaku Yamahata <yamahata@valinux.co.jp>,
	xen-devel@lists.xensource.com, samuel.thibault@ens-lyon.org
Subject: Re: [PATCH 2/2] ioemu: initialize vram area to 0xff
Date: Fri, 16 Jan 2009 16:18:11 +0000	[thread overview]
Message-ID: <4970B343.2040707@eu.citrix.com> (raw)
In-Reply-To: <18800.45351.340857.93487@mariner.uk.xensource.com>

Ian Jackson wrote:

> Stefano Stabellini writes ("Re: [PATCH 2/2] ioemu: initialize vram area to 0xff"):
>> [stuff]
> 
> We seem to be reaching agreement here ?  I'm afraid I've slightly lost
> track of exactly which hunks of Isaku's patch are now to be
> applied ...
> 
> Ian.
> 



Something like this:

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..d1d61ea 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  */
@@ -2456,7 +2461,6 @@ void xen_vga_vram_map(uint64_t vram_addr, uint32_t vga_ram_size)
     xen_pfn_t *pfn_list;
     int i;
     void *vram;
-    DisplayState *ds;
 
     fprintf(logfile, "mapping video RAM from %llx\n",
 	    (unsigned long long)vram_addr);
@@ -2526,7 +2530,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;
     }

  reply	other threads:[~2009-01-16 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 12:24 [PATCH 2/2] ioemu: initialize vram area to 0xff Isaku Yamahata
2009-01-15 12:49 ` Stefano Stabellini
2009-01-16  5:22   ` Isaku Yamahata
2009-01-16 16:00     ` Stefano Stabellini
2009-01-16 16:09       ` Ian Jackson
2009-01-16 16:18         ` Stefano Stabellini [this message]
2009-01-16 16:27           ` Ian Jackson

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=4970B343.2040707@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    --cc=yamahata@valinux.co.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.