[Spice-commits] Branch 'spice.v5.1' - 10 commits - Makefile cursor.c hw/qxl.c hw/qxl.h hw/spice-vmc.c hw/vga-pci.c hw/vmware_vga.c left_ptr left_ptrmsk pc-bios/vgabios-cirrus.bin pc-bios/vgabios-qxl.bin pc-bios/vgabios-qxldev.bin pc-bios/vgabios-stdvga.bin pc-bios/vgabios-vmware.bin pc-bios/vgabios.bin
Gerd Hoffmann
kraxel at kemper.freedesktop.org
Fri May 7 13:41:13 PDT 2010
Makefile | 5 +--
cursor.c | 41 +++++++++++++++++++++++---
hw/qxl.c | 70 ++++++++++++++++++++++++++++++++++++---------
hw/qxl.h | 6 +++
hw/spice-vmc.c | 1
hw/vga-pci.c | 7 +---
hw/vmware_vga.c | 7 ----
left_ptr | 8 +++++
left_ptrmsk | 6 +++
pc-bios/vgabios-cirrus.bin |binary
pc-bios/vgabios-qxl.bin |binary
pc-bios/vgabios-qxldev.bin |binary
pc-bios/vgabios-stdvga.bin |binary
pc-bios/vgabios-vmware.bin |binary
pc-bios/vgabios.bin |binary
15 files changed, 121 insertions(+), 30 deletions(-)
New commits:
commit 341b86840243a2134c6c55ff17db1053bafa9738
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Fri May 7 22:04:34 2010 +0200
adapt spice-vmc to virtio-serial changes
diff --git a/hw/spice-vmc.c b/hw/spice-vmc.c
index f4ab3b6..802e754 100644
--- a/hw/spice-vmc.c
+++ b/hw/spice-vmc.c
@@ -190,6 +190,7 @@ static VirtIOSerialPortInfo vmc_info = {
.guest_ready = vmc_guest_ready,
.have_data = vmc_have_data,
.qdev.props = (Property[]) {
+ DEFINE_PROP_UINT32("nr", SpiceVirtualChannel, port.id, VIRTIO_CONSOLE_BAD_ID),
DEFINE_PROP_UINT32("debug", SpiceVirtualChannel, debug, 1),
DEFINE_PROP_END_OF_LIST(),
}
commit 7aecc922e362c3ad84a05f035253100a02b01f6f
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Fri May 7 16:55:19 2010 +0200
qxl: save vga ram [temporary]
Fixed migration. Shouldn't be needed though.
Probably need set_dirty() for host ring updates.
diff --git a/hw/qxl.c b/hw/qxl.c
index e49e987..2af7d80 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1229,6 +1229,7 @@ static void qxl_pre_save(void *opaque)
}
assert(d->last_release_offset < d->vga.vram_size);
#endif
+ d->fixme = qemu_get_ram_ptr(d->vga.vram_offset);
}
static void qxl_post_save(void *opaque)
@@ -1246,6 +1247,7 @@ static int qxl_pre_load(void *opaque)
qxl_hard_reset(d);
qxl_exit_vga_mode(d);
dprintf(d, 1, "%s: done\n", __FUNCTION__);
+ d->fixme = qemu_get_ram_ptr(d->vga.vram_offset);
return 0;
}
@@ -1350,8 +1352,8 @@ static VMStateDescription qxl_vmstate = {
#endif
VMSTATE_UINT32(mode, PCIQXLDevice),
VMSTATE_UINT32(ssd.unique, PCIQXLDevice),
-#if 0 /* needed? this is qemu_alloc_ram() allocated ... */
- VMSTATE_PARTIAL_VBUFFER_UINT32(ram_start, PCIQXLDevice, vga.vram_size),
+#if 1 /* needed? this is qemu_alloc_ram() allocated ... */
+ VMSTATE_PARTIAL_VBUFFER_UINT32(fixme, PCIQXLDevice, vga.vram_size),
#endif
#if 0 /* FIXME: spice server saves cursor here. needs redesign */
VMSTATE_INT32(worker_data_size, PCIQXLDevice),
diff --git a/hw/qxl.h b/hw/qxl.h
index fbc528f..4d4a5f7 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -61,6 +61,7 @@ typedef struct PCIQXLDevice {
uint32_t num_free_res;
QXLReleaseInfo *last_release;
uint32_t last_release_offset;
+ uint8_t *fixme;
/* rom pci bar */
QXLRom shadow_rom;
commit 7d0a1cfb4150cfd900d3360bb87233681dcd7925
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Fri May 7 16:40:07 2010 +0200
qxl: save last_release state
diff --git a/hw/qxl.c b/hw/qxl.c
index b410a65..e49e987 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1218,13 +1218,14 @@ 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);
dprintf(d, 1, "%s:\n", __FUNCTION__);
-#if 0
+#if 1 /* wanna zap this */
if (d->last_release == NULL) {
d->last_release_offset = 0;
} else {
- d->last_release_offset = (uint8_t *)d->last_release - d->ram_start;
+ d->last_release_offset = (uint8_t *)d->last_release - ram_start;
}
assert(d->last_release_offset < d->vga.vram_size);
#endif
@@ -1251,6 +1252,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);
int i, newmode;
dprintf(d, 1, "%s: start\n", __FUNCTION__);
@@ -1283,9 +1285,9 @@ static int qxl_post_load(void *opaque, int version)
}
dprintf(d, 1, "%s: done\n", __FUNCTION__);
-#if 0
+#if 1 /* wanna zap this */
if (d->last_release_offset >= d->vga.vram_size) {
- dprintf(1, "%s: invalid last_release_offset %u, ram_size %u\n",
+ dprintf(d, 1, "%s: invalid last_release_offset %u, ram_size %u\n",
__FUNCTION__, d->last_release_offset, d->vga.vram_size);
exit(-1);
}
@@ -1293,7 +1295,7 @@ static int qxl_post_load(void *opaque, int version)
if (d->last_release_offset == 0) {
d->last_release = NULL;
} else {
- d->last_release = (QXLReleaseInfo *)(d->ram_start + d->last_release_offset);
+ d->last_release = (QXLReleaseInfo *)(ram_start + d->last_release_offset);
}
#endif
@@ -1342,7 +1344,7 @@ static VMStateDescription qxl_vmstate = {
VMSTATE_PCI_DEVICE(pci, PCIQXLDevice),
VMSTATE_STRUCT(vga, PCIQXLDevice, 0, vmstate_vga_common, VGACommonState),
VMSTATE_UINT32(shadow_rom.mode, PCIQXLDevice),
-#if 0 /* wanna zap this */
+#if 1 /* wanna zap this */
VMSTATE_UINT32(num_free_res, PCIQXLDevice),
VMSTATE_UINT32(last_release_offset, PCIQXLDevice),
#endif
diff --git a/hw/qxl.h b/hw/qxl.h
index c12fe08..fbc528f 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -58,8 +58,9 @@ typedef struct PCIQXLDevice {
/* ram pci bar */
QXLRam *ram;
VGACommonState vga;
- int num_free_res;
+ uint32_t num_free_res;
QXLReleaseInfo *last_release;
+ uint32_t last_release_offset;
/* rom pci bar */
QXLRom shadow_rom;
commit ebf7cae502d46d616379855bf309b997088b81e5
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Fri May 7 15:43:02 2010 +0200
qxl: load surfaces+cursor
diff --git a/hw/qxl.c b/hw/qxl.c
index 67604d0..b410a65 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -292,6 +292,24 @@ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
uint32_t flags = 0;
int notify;
+ if (qxl->load_surfaces) {
+ while (qxl->load_surface_id < NUM_SURFACES &&
+ qxl->guest_surfaces.cmds[qxl->load_surface_id] == 0)
+ qxl->load_surface_id++;
+ if (qxl->load_surface_id < NUM_SURFACES) {
+ dprintf(qxl, 1, "loading surface %d\n", qxl->load_surface_id);
+ ext->cmd.data = qxl->guest_surfaces.cmds[qxl->load_surface_id];
+ ext->cmd.type = QXL_CMD_SURFACE;
+ ext->group_id = MEMSLOT_GROUP_GUEST;
+ ext->flags = 0;
+ qxl->load_surface_id++;
+ return true;
+ } else {
+ dprintf(qxl, 1, "loading surfaces finished\n");
+ qxl->load_surfaces = false;
+ }
+ }
+
switch (qxl->mode) {
case QXL_MODE_VGA:
dprintf(qxl, 2, "%s: vga\n", __FUNCTION__);
@@ -426,6 +444,16 @@ static int interface_get_cursor_command(QXLInstance *sin, struct QXLCommandExt *
uint32_t flags = 0;
int notify;
+ if (qxl->load_cursor) {
+ dprintf(qxl, 1, "loading cursor\n");
+ ext->cmd.data = qxl->guest_cursor;
+ ext->cmd.type = QXL_CMD_CURSOR;
+ ext->group_id = MEMSLOT_GROUP_GUEST;
+ ext->flags = 0;
+ qxl->load_cursor = false;
+ return true;
+ }
+
switch (qxl->mode) {
case QXL_MODE_COMPAT:
flags = QXL_COMMAND_FLAG_COMPAT;
@@ -1241,7 +1269,13 @@ static int qxl_post_load(void *opaque, int version)
qxl_add_memslot(d, i);
}
qxl_create_guest_primary(d);
- /* TODO: replay surface-create and cursor-set commands */
+
+ /* replay surface-create and cursor-set commands */
+ d->load_surfaces = true;
+ d->load_surface_id = 0;
+ if (d->guest_cursor)
+ d->load_cursor = true;
+
break;
case QXL_MODE_COMPAT:
qxl_set_mode(d, d->shadow_rom.mode);
diff --git a/hw/qxl.h b/hw/qxl.h
index 7cf6615..c12fe08 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -48,6 +48,8 @@ typedef struct PCIQXLDevice {
uint32_t max;
} guest_surfaces;
QXLPHYSICAL guest_cursor;
+ bool load_cursor, load_surfaces;
+ int load_surface_id;
/* thread signaling */
pthread_t main;
commit 70b80da8b434f4ebf0c393d0f143e7c7323001fb
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Fri May 7 15:25:02 2010 +0200
add new vgabioses to blob list
diff --git a/Makefile b/Makefile
index 4c00a50..3ff68f3 100644
--- a/Makefile
+++ b/Makefile
@@ -176,8 +176,9 @@ ar de en-us fi fr-be hr it lv nl pl ru th \
common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
ifdef INSTALL_BLOBS
-BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin vgabios-qxl.bin ppc_rom.bin \
-video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
+BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin \
+vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-qxldev.bin \
+ppc_rom.bin video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
gpxe-eepro100-80861209.rom \
gpxe-eepro100-80861229.rom \
pxe-e1000.bin \
commit 33986516034fa5cfddd59d2976627a01def27bd1
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Fri May 7 10:26:27 2010 +0200
cursor: switch to x11 bitmaps [wip]
diff --git a/cursor.c b/cursor.c
index 3995a31..5c50220 100644
--- a/cursor.c
+++ b/cursor.c
@@ -1,6 +1,10 @@
#include "qemu-common.h"
#include "console.h"
+#include "left_ptr"
+#include "left_ptrmsk"
+
+#if 0
static const char cursor_hidden_32[32*32];
static const char cursor_left_ptr_32[32*32] = {
" "
@@ -48,6 +52,8 @@ static void cursor_parse_ascii_art(QEMUCursor *c, const char *ptr)
}
}
+#endif
+
/* nice for debugging */
void cursor_print_ascii_art(QEMUCursor *c, const char *prefix)
{
@@ -71,23 +77,50 @@ void cursor_print_ascii_art(QEMUCursor *c, const char *prefix)
}
}
+static void cursor_parse_x11_bitmap(QEMUCursor *c, const char *image, const char *mask)
+{
+ uint32_t *data = c->data;
+ uint8_t bit;
+ int x,y,bpl;
+
+ bpl = cursor_get_mono_bpl(c);
+ for (y = 0; y < c->height; y++) {
+ for (x = 0; x < c->width; x++, data++) {
+ bit = (1 << (x%8));
+ if (!(mask[x/8] & bit)) {
+ *data = 0x00000000;
+ } else if (image[x/8] & bit) {
+ *data = 0xffffffff;
+ } else {
+ *data = 0xff000000;
+ }
+ }
+ mask += bpl;
+ image += bpl;
+ }
+}
+
QEMUCursor *cursor_builtin_hidden(void)
{
+#if 0
QEMUCursor *c;
c = cursor_alloc(32, 32);
cursor_parse_ascii_art(c, cursor_hidden_32);
return c;
+#else
+ return NULL;
+#endif
}
QEMUCursor *cursor_builtin_left_ptr(void)
{
QEMUCursor *c;
- c = cursor_alloc(32, 32);
- cursor_parse_ascii_art(c, cursor_left_ptr_32);
- c->hot_x = 1;
- c->hot_y = 1;
+ c = cursor_alloc(left_ptr_width, left_ptr_height);
+ cursor_parse_x11_bitmap(c, left_ptr_bits, left_ptrmsk_bits);
+ c->hot_x = left_ptr_x_hot;
+ c->hot_y = left_ptr_y_hot;
return c;
}
diff --git a/left_ptr b/left_ptr
new file mode 100644
index 0000000..8a6abb1
--- /dev/null
+++ b/left_ptr
@@ -0,0 +1,8 @@
+#define left_ptr_width 16
+#define left_ptr_height 16
+#define left_ptr_x_hot 3
+#define left_ptr_y_hot 1
+static char left_ptr_bits[] = {
+ 0x00, 0x00, 0x08, 0x00, 0x18, 0x00, 0x38, 0x00, 0x78, 0x00, 0xf8, 0x00,
+ 0xf8, 0x01, 0xf8, 0x03, 0xf8, 0x07, 0xf8, 0x00, 0xd8, 0x00, 0x88, 0x01,
+ 0x80, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00};
diff --git a/left_ptrmsk b/left_ptrmsk
new file mode 100644
index 0000000..851911d
--- /dev/null
+++ b/left_ptrmsk
@@ -0,0 +1,6 @@
+#define left_ptrmsk_width 16
+#define left_ptrmsk_height 16
+static char left_ptrmsk_bits[] = {
+ 0x0c, 0x00, 0x1c, 0x00, 0x3c, 0x00, 0x7c, 0x00, 0xfc, 0x00, 0xfc, 0x01,
+ 0xfc, 0x03, 0xfc, 0x07, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x01, 0xdc, 0x03,
+ 0xcc, 0x03, 0x80, 0x07, 0x80, 0x07, 0x00, 0x03};
commit 1153fffe5653c728832822c2fd70722fb2be4424
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Thu May 6 15:17:40 2010 +0200
adapt qxl to new vgabios.
diff --git a/hw/qxl.c b/hw/qxl.c
index 7fe644c..67604d0 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1104,6 +1104,9 @@ static int qxl_init(PCIDevice *dev)
qxl->mode = QXL_MODE_UNDEFINED;
qxl->generation = 1;
+ if (qxl->device_id != 0x100 && qxl->device_id != QXL_DEVICE_ID)
+ qxl->device_id = QXL_DEVICE_ID;
+
if (!qxl->id) {
if (ram_size < 32 * 1024 * 1024)
ram_size = 32 * 1024 * 1024;
@@ -1125,8 +1128,13 @@ static int qxl_init(PCIDevice *dev)
qxl0 = qxl;
register_displaychangelistener(vga->ds, &display_listener);
- if (qxl->pci.romfile == NULL)
- qxl->pci.romfile = qemu_strdup("vgabios-qxl.bin");
+ if (qxl->pci.romfile == NULL) {
+ if (qxl->device_id == 0x100) {
+ qxl->pci.romfile = qemu_strdup("vgabios-qxl.bin");
+ } else {
+ qxl->pci.romfile = qemu_strdup("vgabios-qxldev.bin");
+ }
+ }
pci_config_set_class(config, PCI_CLASS_DISPLAY_VGA);
} else {
if (ram_size < 16 * 1024 * 1024)
@@ -1138,8 +1146,6 @@ static int qxl_init(PCIDevice *dev)
}
pci_config_set_vendor_id(config, REDHAT_PCI_VENDOR_ID);
- if (qxl->device_id != 0x100 && qxl->device_id != QXL_DEVICE_ID)
- qxl->device_id = QXL_DEVICE_ID;
pci_config_set_device_id(config, qxl->device_id);
pci_set_byte(&config[PCI_REVISION_ID], QXL_REVISION);
pci_set_byte(&config[PCI_INTERRUPT_PIN], 1);
commit e0ff037857e8e963af544882d667833e824cb2d9
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Thu May 6 11:14:11 2010 +0200
switch vmware_vga to pci vgabios
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index bf2a699..4e7a75d 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -114,14 +114,12 @@ struct pci_vmsvga_state_s {
# define SVGA_IO_BASE SVGA_LEGACY_BASE_PORT
# define SVGA_IO_MUL 1
# define SVGA_FIFO_SIZE 0x10000
-# define SVGA_MEM_BASE 0xe0000000
# define SVGA_PCI_DEVICE_ID PCI_DEVICE_ID_VMWARE_SVGA2
#else
# define SVGA_ID SVGA_ID_1
# define SVGA_IO_BASE SVGA_LEGACY_BASE_PORT
# define SVGA_IO_MUL 4
# define SVGA_FIFO_SIZE 0x10000
-# define SVGA_MEM_BASE 0xe0000000
# define SVGA_PCI_DEVICE_ID PCI_DEVICE_ID_VMWARE_SVGA
#endif
@@ -1171,10 +1169,6 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
vga_init(&s->vga);
vmstate_register(0, &vmstate_vga_common, &s->vga);
- vga_init_vbe(&s->vga);
-
- rom_add_vga(VGABIOS_FILENAME);
-
vmsvga_reset(s);
}
@@ -1276,6 +1270,7 @@ static PCIDeviceInfo vmsvga_info = {
.qdev.size = sizeof(struct pci_vmsvga_state_s),
.qdev.vmsd = &vmstate_vmware_vga,
.init = pci_vmsvga_initfn,
+ .romfile = "vgabios-vmware.bin",
};
static void vmsvga_register(void)
commit 391e14019e6ecc6f5baa75422f4c1f2c26853b2b
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Thu May 6 11:13:11 2010 +0200
switch stdvga to pci vgabios
diff --git a/hw/vga-pci.c b/hw/vga-pci.c
index eef78ed..c8d260c 100644
--- a/hw/vga-pci.c
+++ b/hw/vga-pci.c
@@ -104,11 +104,10 @@ static int pci_vga_initfn(PCIDevice *dev)
bios_total_size <<= 1;
pci_register_bar(&d->dev, PCI_ROM_SLOT, bios_total_size,
PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);
+ } else {
+ if (dev->romfile == NULL)
+ dev->romfile = qemu_strdup("vgabios-stdvga.bin");
}
-
- vga_init_vbe(s);
- /* ROM BIOS */
- rom_add_vga(VGABIOS_FILENAME);
return 0;
}
commit 365813182a6db07f2c5432114a307cdd06d6648e
Author: Gerd Hoffmann <kraxel at redhat.com>
Date: Thu May 6 11:01:40 2010 +0200
vgabios update to 0.6c + pcibios patches.
diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin
index ae3983e..ffd37d8 100644
Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ
diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin
index 04a3e44..2732d55 100644
Binary files a/pc-bios/vgabios-qxl.bin and b/pc-bios/vgabios-qxl.bin differ
diff --git a/pc-bios/vgabios-qxldev.bin b/pc-bios/vgabios-qxldev.bin
new file mode 100644
index 0000000..83e2161
Binary files /dev/null and b/pc-bios/vgabios-qxldev.bin differ
diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin
new file mode 100644
index 0000000..6ec49fe
Binary files /dev/null and b/pc-bios/vgabios-stdvga.bin differ
diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin
new file mode 100644
index 0000000..76173c2
Binary files /dev/null and b/pc-bios/vgabios-vmware.bin differ
diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin
index e319bf0..1d94417 100644
Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ
More information about the Spice-commits
mailing list