On 08/01/11 12:21, Alon Levy wrote:
This reverts commit 22795174a37e02200944c0d093d518e832650686.

Without this patch the windows logo animation during boot time was
correct, with it it jumps backwards and forwards erratically.

Looking at how the x11 qxl driver generates mm_time I see it just grabs the timestamp from qxl rom, which in turn is filled by the spice server callback.

So how about doing the same in vga mode (see patch, untested)?

cheers,
  Gerd
diff --git a/hw/qxl.c b/hw/qxl.c
index a6fb7f0..7be7c9a 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -319,6 +319,7 @@ static void interface_set_mm_time(QXLInstance *sin, 
uint32_t mm_time)
 
     qxl->shadow_rom.mm_clock = cpu_to_le32(mm_time);
     qxl->rom->mm_clock = cpu_to_le32(mm_time);
+    qxl->ssd.mm_clock = mm_time;
     qxl_rom_set_dirty(qxl);
 }
 
diff --git a/ui/spice-display.c b/ui/spice-display.c
index feeee73..e5f3093 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -70,7 +70,6 @@ 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;
@@ -97,10 +96,7 @@ 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->mm_time = ssd->mm_clock;
 
     drawable->u.copy.rop_descriptor  = SPICE_ROPD_OP_PUT;
     drawable->u.copy.src_bitmap      = (intptr_t)image;
@@ -290,8 +286,10 @@ static void interface_set_compression_level(QXLInstance 
*sin, int level)
 
 static void interface_set_mm_time(QXLInstance *sin, uint32_t mm_time)
 {
+    SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
+
     dprint(3, "%s:\n", __FUNCTION__);
-    /* nothing to do */
+    ssd->mm_clock = mm_time;
 }
 
 static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info)
diff --git a/ui/spice-display.h b/ui/spice-display.h
index 2f95f68..68272e1 100644
--- a/ui/spice-display.h
+++ b/ui/spice-display.h
@@ -43,6 +43,7 @@ struct SimpleSpiceDisplay {
     QXLWorker *worker;
     QXLInstance qxl;
     uint32_t unique;
+    uint32_t mm_clock;
     QemuPfConv *conv;
 
     QXLRect dirty;

Reply via email to