[Spice-commits] Branch 'spice.kvm.v18' - 3 commits - hw/qxl-render.c hw/qxl.c hw/qxl.h

Gerd Hoffmann kraxel at kemper.freedesktop.org
Mon Sep 6 06:32:30 PDT 2010


 hw/qxl-render.c |    4 ++++
 hw/qxl.c        |   15 ++++++++++++---
 hw/qxl.h        |    1 +
 3 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 792e7ae57cee416f0ea9cb35d445e2bb7c87be0f
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Mon Sep 6 15:04:30 2010 +0200

    qxl: add guestdebug property

diff --git a/hw/qxl.c b/hw/qxl.c
index 991858e..63a96e8 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -140,6 +140,7 @@ static void init_qxl_rom(PCIQXLDevice *d)
 
     rom->magic         = cpu_to_le32(QXL_ROM_MAGIC);
     rom->id            = cpu_to_le32(d->id);
+    rom->log_level     = cpu_to_le32(d->guestdebug);
     rom->modes_offset  = cpu_to_le32(sizeof(QXLRom));
 
     rom->slot_gen_bits = MEMSLOT_GENERATION_BITS;
@@ -920,7 +921,9 @@ static void ioport_write(void *opaque, uint32_t addr, uint32_t val)
         qxl_set_mode(d, val);
         break;
     case QXL_IO_LOG:
-        dprint(d, 1, "log %s", d->ram->log_buf);
+        if (d->guestdebug) {
+            fprintf(stderr, "qxl/guest: %s", d->ram->log_buf);
+        }
         break;
     case QXL_IO_RESET:
         dprint(d, 1, "QXL_IO_RESET\n");
@@ -1500,6 +1503,7 @@ static PCIDeviceInfo qxl_info = {
         DEFINE_PROP_UINT32("vram_size", PCIQXLDevice, vram_size, 64 * 1024 * 1024),
         DEFINE_PROP_UINT32("revision", PCIQXLDevice, revision, 2),
         DEFINE_PROP_UINT32("debug", PCIQXLDevice, debug, 0),
+        DEFINE_PROP_UINT32("guestdebug", PCIQXLDevice, guestdebug, 0),
         DEFINE_PROP_UINT32("cmdlog", PCIQXLDevice, cmdlog, 0),
         DEFINE_PROP_END_OF_LIST(),
     }
diff --git a/hw/qxl.h b/hw/qxl.h
index 91fef48..8c0c928 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -18,6 +18,7 @@ typedef struct PCIQXLDevice {
     SimpleSpiceDisplay ssd;
     int                id;
     uint32_t           debug;
+    uint32_t           guestdebug;
     uint32_t           cmdlog;
     enum qxl_mode      mode;
     uint32_t           cmdflags;
commit f6a60a69b8d8f5bddd5d12caaeab06a6aec7cc17
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Mon Sep 6 14:56:57 2010 +0200

    [temporary] qxl: disable cursor callbacks
    
    Will deadlock in case cursor rendering is triggered via
    QXL_IO_UPDATE_AREA.

diff --git a/hw/qxl-render.c b/hw/qxl-render.c
index b92c68c..2b1c6e7 100644
--- a/hw/qxl-render.c
+++ b/hw/qxl-render.c
@@ -196,18 +196,22 @@ void qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext)
         if (c == NULL) {
             c = cursor_builtin_left_ptr();
         }
+#if 0
         qemu_mutex_lock_iothread();
         qxl->ssd.ds->cursor_define(c);
         qxl->ssd.ds->mouse_set(x, y, 1);
         qemu_mutex_unlock_iothread();
+#endif
         cursor_put(c);
         break;
     case QXL_CURSOR_MOVE:
         x = cmd->u.position.x;
         y = cmd->u.position.y;
+#if 0
         qemu_mutex_lock_iothread();
         qxl->ssd.ds->mouse_set(x, y, 1);
         qemu_mutex_unlock_iothread();
+#endif
         break;
     }
 }
commit 6e406d7c62453f30d4b0ab71544c12ff64f25512
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Mon Sep 6 12:02:21 2010 +0200

    [rhel6 compat]: qxl: compat io size

diff --git a/hw/qxl.c b/hw/qxl.c
index 6c76bdc..991858e 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1162,6 +1162,7 @@ static int qxl_init(PCIDevice *dev)
     ram_addr_t ram_size = msb_mask(qxl->vga.vram_size * 2 - 1);
     uint32_t pci_device_id;
     uint32_t pci_device_rev;
+    uint32_t io_size;
 
     if (device_id == 0 && dev->qdev.hotplugged) {
         device_id++;
@@ -1247,9 +1248,13 @@ static int qxl_init(PCIDevice *dev)
     qxl->vram_size = msb_mask(qxl->vram_size * 2 - 1);
     qxl->vram_offset = qemu_ram_alloc(&qxl->pci.qdev, "qxl.vram", qxl->vram_size);
 
+    io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);
+    if (qxl->revision == 1) {
+        io_size = 8;
+    }
+
     pci_register_bar(&qxl->pci, QXL_IO_RANGE_INDEX,
-                     msb_mask(QXL_IO_RANGE_SIZE * 2 - 1),
-                     PCI_BASE_ADDRESS_SPACE_IO, qxl_map);
+                     io_size, PCI_BASE_ADDRESS_SPACE_IO, qxl_map);
 
     pci_register_bar(&qxl->pci, QXL_ROM_RANGE_INDEX,
                      qxl->rom_size, PCI_BASE_ADDRESS_SPACE_MEMORY,


More information about the Spice-commits mailing list