Skip to contentSkip to conversation

spice patch queue

GIT PULL New Gerd Hoffmann 2 participants 12 messages Jul 4, 2011 – Jul 19, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

Here is the spice patch queue with a bunch of small fixes and improvements collected over time. No major changes.

please pull,
Gerd

Alon Levy (5):
qxl: set mm_time in vga update
qxl: interface_get_command: fix reported mode
qxl-logger: add timestamp to command log
qxl: add dev id to guest prints
qxl: allow QXL_IO_LOG also in vga

Gerd Hoffmann (3):
qxl: device id fixup
spice: catch spice server initialization failures.
qxl: put QXL_IO_UPDATE_IRQ into vgamode whitelist

Yonit Halperin (1):
qxl: make sure primary surface is saved on migration

 hw/qxl-logger.c    |    4 +++-
 hw/qxl.c           |   50 ++++++++++++++++++++++++++++++++++----------------
 ui/spice-core.c    |    5 ++++-
 ui/spice-display.c |    5 +++++
 4 files changed, 46 insertions(+), 18 deletions(-)

The following changes since commit 75ef849696830fc2ddeff8bb90eea5887ff50df6:

esp: correctly fill bus id with requested lun (2011-07-02 18:50:19 +0000)

are available in the git repository at:
git://anongit.freedesktop.org/spice/qemu spice.v38

Alon Levy (5):
qxl: set mm_time in vga update
qxl: interface_get_command: fix reported mode
qxl-logger: add timestamp to command log
qxl: add dev id to guest prints
qxl: allow QXL_IO_LOG also in vga

Gerd Hoffmann (3):
qxl: device id fixup
spice: catch spice server initialization failures.
qxl: put QXL_IO_UPDATE_IRQ into vgamode whitelist

Yonit Halperin (1):
qxl: make sure primary surface is saved on migration

 hw/qxl-logger.c    |    4 +++-
 hw/qxl.c           |   50 ++++++++++++++++++++++++++++++++++----------------
 ui/spice-core.c    |    5 ++++-
 ui/spice-display.c |    5 +++++
 4 files changed, 46 insertions(+), 18 deletions(-)
#1 lore raw

PATCH 1/9 qxl: device id fixup

Move device ID to PCIDeviceInfo.
Remove support for the unused unstable device ID.

---
 hw/qxl.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
hw/qxl.c +3 -8
index 16316f2..e95d6f7 100644
@@ -1207,7 +1207,6 @@ static DisplayChangeListener display_listener = {
 static int qxl_init_common(PCIQXLDevice *qxl)
 {
     uint8_t* config = qxl->pci.config;
-    uint32_t pci_device_id;
     uint32_t pci_device_rev;
     uint32_t io_size;
 
@@ -1218,20 +1217,14 @@ static int qxl_init_common(PCIQXLDevice *qxl)
 
     switch (qxl->revision) {
     case 1: /* spice 0.4 -- qxl-1 */
-        pci_device_id  = QXL_DEVICE_ID_STABLE;
         pci_device_rev = QXL_REVISION_STABLE_V04;
         break;
     case 2: /* spice 0.6 -- qxl-2 */
-        pci_device_id  = QXL_DEVICE_ID_STABLE;
+    default:
         pci_device_rev = QXL_REVISION_STABLE_V06;
         break;
-    default: /* experimental */
-        pci_device_id  = QXL_DEVICE_ID_DEVEL;
-        pci_device_rev = 1;
-        break;
     }
 
-    pci_config_set_device_id(config, pci_device_id);
     pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev);
     pci_set_byte(&config[PCI_INTERRUPT_PIN], 1);
 
@@ -1492,6 +1485,7 @@ static PCIDeviceInfo qxl_info_primary = {
     .config_write = qxl_write_config,
     .romfile      = "vgabios-qxl.bin",
     .vendor_id    = REDHAT_PCI_VENDOR_ID,
+    .device_id    = QXL_DEVICE_ID_STABLE,
     .class_id     = PCI_CLASS_DISPLAY_VGA,
     .qdev.props = (Property[]) {
         DEFINE_PROP_UINT32("ram_size", PCIQXLDevice, vga.vram_size, 64 * 1024 * 1024),
@@ -1512,6 +1506,7 @@ static PCIDeviceInfo qxl_info_secondary = {
     .qdev.vmsd    = &qxl_vmstate,
     .init         = qxl_init_secondary,
     .vendor_id    = REDHAT_PCI_VENDOR_ID,
+    .device_id    = QXL_DEVICE_ID_STABLE,
     .class_id     = PCI_CLASS_DISPLAY_OTHER,
     .qdev.props = (Property[]) {
         DEFINE_PROP_UINT32("ram_size", PCIQXLDevice, vga.vram_size, 64 * 1024 * 1024),
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/9 spice: catch spice server initialization failures.

In reply to Gerd Hoffmann

When the spice server initialization fails report this and exit instead of ignoring the error.

---
 ui/spice-core.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
ui/spice-core.c +4 -1
index dd9905b..e142452 100644
@@ -602,7 +602,10 @@ void qemu_spice_init(void)
 
     qemu_opt_foreach(opts, add_channel, NULL, 0);
 
-    spice_server_init(spice_server, &core_interface);
+    if (0 != spice_server_init(spice_server, &core_interface)) {
+        fprintf(stderr, "failed to initialize spice server");
+        exit(1);
+    };
     using_spice = 1;
 
     migration_state.notify = migration_state_notifier;
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/9 qxl: set mm_time in vga update

In reply to Gerd Hoffmann

From: Alon Levy <[email protected]>

This fixes a problem where on windows 7 startup phase, before the qxl driver is loaded, the drawables are sufficiently large and video like to trigger a stream, but the lack of a filled mm time field triggers a warning in spice-gtk.

---
 ui/spice-display.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
ui/spice-display.c +5 -0
index 15f0704..feeee73 100644
@@ -70,6 +70,7 @@ static SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
     QXLCommand *cmd;
     uint8_t *src, *dst;
     int by, bw, bh;
+    struct timespec time_space;
 
     if (qemu_spice_rect_is_empty(&ssd->dirty)) {
         return NULL;
@@ -96,6 +97,10 @@ static SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
     drawable->surfaces_dest[0] = -1;
     drawable->surfaces_dest[1] = -1;
     drawable->surfaces_dest[2] = -1;
+    clock_gettime(CLOCK_MONOTONIC, &time_space);
+    /* time in milliseconds from epoch. */
+    drawable->mm_time = time_space.tv_sec * 1000
+                      + time_space.tv_nsec / 1000 / 1000;
 
     drawable->u.copy.rop_descriptor  = SPICE_ROPD_OP_PUT;
     drawable->u.copy.src_bitmap      = (intptr_t)image;
Signature · 1 line
1.7.1
#4 lore raw

PATCH 4/9 qxl: interface_get_command: fix reported mode

In reply to Gerd Hoffmann

From: Alon Levy <[email protected]>

report correct mode when in undefined mode.
introduces qxl_mode_to_string(), and uses it in other places too.

---
 hw/qxl.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)
hw/qxl.c +21 -4
index e95d6f7..3722f55 100644
@@ -336,6 +336,21 @@ static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info)
     info->n_surfaces = NUM_SURFACES;
 }
 
+static const char *qxl_mode_to_string(int mode)
+{
+    switch (mode) {
+    case QXL_MODE_COMPAT:
+        return "compat";
+    case QXL_MODE_NATIVE:
+        return "native";
+    case QXL_MODE_UNDEFINED:
+        return "undefined";
+    case QXL_MODE_VGA:
+        return "vga";
+    }
+    return "INVALID";
+}
+
 /* called from spice server thread context only */
 static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
 {
@@ -358,18 +373,19 @@ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
         }
         qemu_mutex_unlock(&qxl->ssd.lock);
         if (ret) {
+            dprint(qxl, 2, "%s %s\n", __FUNCTION__, qxl_mode_to_string(qxl->mode));
             qxl_log_command(qxl, "vga", ext);
         }
         return ret;
     case QXL_MODE_COMPAT:
     case QXL_MODE_NATIVE:
     case QXL_MODE_UNDEFINED:
-        dprint(qxl, 2, "%s: %s\n", __FUNCTION__,
-               qxl->cmdflags ? "compat" : "native");
+        dprint(qxl, 4, "%s: %s\n", __FUNCTION__, qxl_mode_to_string(qxl->mode));
         ring = &qxl->ram->cmd_ring;
         if (SPICE_RING_IS_EMPTY(ring)) {
             return false;
         }
+        dprint(qxl, 2, "%s: %s\n", __FUNCTION__, qxl_mode_to_string(qxl->mode));
         SPICE_RING_CONS_ITEM(ring, cmd);
         ext->cmd      = *cmd;
         ext->group_id = MEMSLOT_GROUP_GUEST;
@@ -993,7 +1009,7 @@ static void ioport_write(void *opaque, uint32_t addr, uint32_t val)
         break;
     case QXL_IO_DESTROY_PRIMARY:
         PANIC_ON(val != 0);
-        dprint(d, 1, "QXL_IO_DESTROY_PRIMARY\n");
+        dprint(d, 1, "QXL_IO_DESTROY_PRIMARY (%s)\n", qxl_mode_to_string(d->mode));
         qxl_destroy_primary(d);
         break;
     case QXL_IO_DESTROY_SURFACE_WAIT:
@@ -1368,7 +1384,8 @@ static int qxl_post_load(void *opaque, int version)
 
     d->modes = (QXLModes*)((uint8_t*)d->rom + d->rom->modes_offset);
 
-    dprint(d, 1, "%s: restore mode\n", __FUNCTION__);
+    dprint(d, 1, "%s: restore mode (%s)\n", __FUNCTION__,
+        qxl_mode_to_string(d->mode));
     newmode = d->mode;
     d->mode = QXL_MODE_UNDEFINED;
     switch (newmode) {
Signature · 1 line
1.7.1
#5 lore raw

PATCH 5/9 qxl-logger: add timestamp to command log

In reply to Gerd Hoffmann

From: Alon Levy <[email protected]>

---
 hw/qxl-logger.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
hw/qxl-logger.c +3 -1
index 76f43e6..74cadba 100644
@@ -19,6 +19,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu-timer.h"
 #include "qxl.h"
 
 static const char *qxl_type[] = {
@@ -223,7 +224,8 @@ void qxl_log_command(PCIQXLDevice *qxl, const char *ring, QXLCommandExt *ext)
     if (!qxl->cmdlog) {
         return;
     }
-    fprintf(stderr, "qxl-%d/%s:", qxl->id, ring);
+    fprintf(stderr, "%ld qxl-%d/%s:", qemu_get_clock_ns(vm_clock),
+            qxl->id, ring);
     fprintf(stderr, " cmd @ 0x%" PRIx64 " %s%s", ext->cmd.data,
             qxl_name(qxl_type, ext->cmd.type),
             compat ? "(compat)" : "");
Signature · 1 line
1.7.1
#6 lore raw

PATCH 6/9 qxl: add dev id to guest prints

In reply to Gerd Hoffmann

From: Alon Levy <[email protected]>

---
 hw/qxl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
hw/qxl.c +2 -1
index 3722f55..d55b68d 100644
@@ -985,7 +985,8 @@ static void ioport_write(void *opaque, uint32_t addr, uint32_t val)
         break;
     case QXL_IO_LOG:
         if (d->guestdebug) {
-            fprintf(stderr, "qxl/guest: %s", d->ram->log_buf);
+            fprintf(stderr, "qxl/guest-%d: %ld: %s", d->id,
+                    qemu_get_clock_ns(vm_clock), d->ram->log_buf);
         }
         break;
     case QXL_IO_RESET:
Signature · 1 line
1.7.1
#7 lore raw

PATCH 7/9 qxl: make sure primary surface is saved on migration

In reply to Gerd Hoffmann

From: Yonit Halperin <[email protected]>

---
 hw/qxl.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
hw/qxl.c +6 -3
index d55b68d..5e49536 100644
@@ -1184,11 +1184,14 @@ static void qxl_vm_change_state_handler(void *opaque, int running, int reason)
     qemu_spice_vm_change_state_handler(&qxl->ssd, running, reason);
 
     if (!running && qxl->mode == QXL_MODE_NATIVE) {
-        /* dirty all vram (which holds surfaces) to make sure it is saved */
+        /* dirty all vram (which holds surfaces) and devram (primary surface)
+         * to make sure they are saved */
         /* FIXME #1: should go out during "live" stage */
         /* FIXME #2: we only need to save the areas which are actually used */
-        ram_addr_t addr = qxl->vram_offset;
-        qxl_set_dirty(addr, addr + qxl->vram_size);
+        ram_addr_t vram_addr = qxl->vram_offset;
+        ram_addr_t surface0_addr = qxl->vga.vram_offset + qxl->shadow_rom.draw_area_offset;
+        qxl_set_dirty(vram_addr, vram_addr + qxl->vram_size);
+        qxl_set_dirty(surface0_addr, surface0_addr + qxl->shadow_rom.surface0_area_size);
     }
 }
 
Signature · 1 line
1.7.1
#8 lore raw

PATCH 8/9 qxl: put QXL_IO_UPDATE_IRQ into vgamode whitelist

In reply to Gerd Hoffmann
---
 hw/qxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/qxl.c +1 -0
index 5e49536..848c90f 100644
@@ -942,6 +942,7 @@ static void ioport_write(void *opaque, uint32_t addr, uint32_t val)
     case QXL_IO_MEMSLOT_ADD:
     case QXL_IO_MEMSLOT_DEL:
     case QXL_IO_CREATE_PRIMARY:
+    case QXL_IO_UPDATE_IRQ:
         break;
     default:
         if (d->mode == QXL_MODE_NATIVE || d->mode == QXL_MODE_COMPAT)
Signature · 1 line
1.7.1
#9 lore raw

PATCH 9/9 qxl: allow QXL_IO_LOG also in vga

In reply to Gerd Hoffmann

From: Alon Levy <[email protected]>

The driver may change us to vga mode and still issue a QXL_IO_LOG, which we can easily support.

---
 hw/qxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/qxl.c +1 -0
index 848c90f..0b9a4c7 100644
@@ -943,6 +943,7 @@ static void ioport_write(void *opaque, uint32_t addr, uint32_t val)
     case QXL_IO_MEMSLOT_DEL:
     case QXL_IO_CREATE_PRIMARY:
     case QXL_IO_UPDATE_IRQ:
+    case QXL_IO_LOG:
         break;
     default:
         if (d->mode == QXL_MODE_NATIVE || d->mode == QXL_MODE_COMPAT)
Signature · 1 line
1.7.1
#10 lore raw
In reply to Gerd Hoffmann
Quoted 8 lines · Gerd Hoffmann
   Hi,

Here is the spice patch queue with a bunch of small fixes and improvements collected over time. No major changes.

please pull,
Gerd

Quoted 6 lines

The following changes since commit 75ef849696830fc2ddeff8bb90eea5887ff50df6:

esp: correctly fill bus id with requested lun (2011-07-02 18:50:19 +0000)

are available in the git repository at:
git://anongit.freedesktop.org/spice/qemu spice.v38

Ping?

cheers,
Gerd

#11 lore raw
In reply to Gerd Hoffmann
Quoted 7 lines · Gerd Hoffmann
   Hi,

Here is the spice patch queue with a bunch of small fixes and improvements collected over time. No major changes.

please pull,
Gerd

Pulled. Thanks.

Regards,

Anthony Liguori

Quoted 51 lines

Alon Levy (5):
qxl: set mm_time in vga update
qxl: interface_get_command: fix reported mode
qxl-logger: add timestamp to command log
qxl: add dev id to guest prints
qxl: allow QXL_IO_LOG also in vga

Gerd Hoffmann (3):
qxl: device id fixup
spice: catch spice server initialization failures.
qxl: put QXL_IO_UPDATE_IRQ into vgamode whitelist

Yonit Halperin (1):
qxl: make sure primary surface is saved on migration

  hw/qxl-logger.c    |    4 +++-
  hw/qxl.c           |   50 ++++++++++++++++++++++++++++++++++----------------
  ui/spice-core.c    |    5 ++++-
  ui/spice-display.c |    5 +++++
  4 files changed, 46 insertions(+), 18 deletions(-)

The following changes since commit 75ef849696830fc2ddeff8bb90eea5887ff50df6:

esp: correctly fill bus id with requested lun (2011-07-02 18:50:19 +0000)

are available in the git repository at:
git://anongit.freedesktop.org/spice/qemu spice.v38

Alon Levy (5):
qxl: set mm_time in vga update
qxl: interface_get_command: fix reported mode
qxl-logger: add timestamp to command log
qxl: add dev id to guest prints
qxl: allow QXL_IO_LOG also in vga

Gerd Hoffmann (3):
qxl: device id fixup
spice: catch spice server initialization failures.
qxl: put QXL_IO_UPDATE_IRQ into vgamode whitelist

Yonit Halperin (1):
qxl: make sure primary surface is saved on migration

  hw/qxl-logger.c    |    4 +++-
  hw/qxl.c           |   50 ++++++++++++++++++++++++++++++++++----------------
  ui/spice-core.c    |    5 ++++-
  ui/spice-display.c |    5 +++++
  4 files changed, 46 insertions(+), 18 deletions(-)