[Spice-commits] Branch 'spice.kvm.v11' - hw/qxl.c

Gerd Hoffmann kraxel at kemper.freedesktop.org
Mon Jul 5 08:12:51 PDT 2010


 hw/qxl.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit dd79f076146b0f5854baab16245131eaa905e101
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Mon Jul 5 17:01:24 2010 +0200

    qxl: don't call qemu_get_ram_ptr from spice server thread context.

diff --git a/hw/qxl.c b/hw/qxl.c
index 5552aec..fee470c 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -184,7 +184,7 @@ static void init_qxl_ram(PCIQXLDevice *d)
     uint8_t *buf;
     uint64_t *item;
 
-    buf = qemu_get_ram_ptr(d->vga.vram_offset);
+    buf = qxl->vga.vram_ptr;
     d->ram = (QXLRam *)(buf + le32_to_cpu(d->shadow_rom.ram_header_offset));
     d->ram->magic       = cpu_to_le32(QXL_RAM_MAGIC);
     d->ram->int_pending = cpu_to_le32(0);
@@ -214,7 +214,7 @@ static void qxl_rom_set_dirty(PCIQXLDevice *qxl)
 static void qxl_ram_set_dirty(PCIQXLDevice *qxl, void *ptr)
 {
     ram_addr_t addr = qxl->vga.vram_offset;
-    void *base = qemu_get_ram_ptr(qxl->vga.vram_offset);
+    void *base = qxl->vga.vram_ptr;
     intptr_t offset;
 
     offset = ptr - base;
@@ -1201,6 +1201,7 @@ static int qxl_init(PCIDevice *dev)
             ram_size = 16 * 1024 * 1024;
         qxl->vga.vram_size = ram_size;
         qxl->vga.vram_offset = qemu_ram_alloc(qxl->vga.vram_size);
+        qxl->vga.vram_ptr = qemu_get_ram_ptr(qxl->vga.vram_offset);
 
         pci_config_set_class(config, PCI_CLASS_DISPLAY_OTHER);
     }
@@ -1250,7 +1251,7 @@ static int qxl_init(PCIDevice *dev)
 static void qxl_pre_save(void *opaque)
 {
     PCIQXLDevice* d = opaque;
-    uint8_t *ram_start = qemu_get_ram_ptr(d->vga.vram_offset);
+    uint8_t *ram_start = qxl->vga.vram_ptr;
 
     dprintf(d, 1, "%s:\n", __FUNCTION__);
 #if 1 /* wanna zap this */
@@ -1277,7 +1278,7 @@ static int qxl_pre_load(void *opaque)
 static int qxl_post_load(void *opaque, int version)
 {
     PCIQXLDevice* d = opaque;
-    uint8_t *ram_start = qemu_get_ram_ptr(d->vga.vram_offset);
+    uint8_t *ram_start = qxl->vga.vram_ptr;
     QXLCommandExt *cmds;
     int in, out, i, newmode;
 


More information about the Spice-commits mailing list