summaryrefslogtreecommitdiff
path: root/hw/qxl.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/qxl.c')
-rw-r--r--hw/qxl.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/hw/qxl.c b/hw/qxl.c
index 01bed135e..154c15f14 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -27,6 +27,10 @@
#include "qxl.h"
+#if SPICE_SERVER_VERSION >= 0x000b00
+#define QXL_HAVE_MONITORS_CONFIG
+#endif
+
#define VGA_RAM_SIZE (8192 * 1024)
/*
@@ -251,6 +255,21 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
}
}
+static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
+{
+#ifdef QXL_HAVE_MONITORS_CONFIG
+ trace_qxl_spice_monitors_config(qxl->id);
+ spice_qxl_monitors_config_async(&qxl->ssd.qxl,
+ qxl->ram->monitors_config,
+ MEMSLOT_GROUP_GUEST,
+ (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
+ QXL_IO_MONITORS_CONFIG_ASYNC));
+#else
+ fprintf(stderr, "%s: spice server too old to support monitors_config\n",
+ __func__);
+#endif
+}
+
void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
{
trace_qxl_spice_reset_image_cache(qxl->id);
@@ -824,6 +843,7 @@ static void interface_async_complete_io(PCIQXLDevice *qxl, QXLCookie *cookie)
case QXL_IO_DESTROY_PRIMARY_ASYNC:
case QXL_IO_UPDATE_AREA_ASYNC:
case QXL_IO_FLUSH_SURFACES_ASYNC:
+ case QXL_IO_MONITORS_CONFIG_ASYNC:
break;
case QXL_IO_CREATE_PRIMARY_ASYNC:
qxl_create_guest_primary_complete(qxl);
@@ -1372,6 +1392,7 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
case QXL_IO_DESTROY_ALL_SURFACES_ASYNC:
io_port = QXL_IO_DESTROY_ALL_SURFACES;
goto async_common;
+ case QXL_IO_MONITORS_CONFIG_ASYNC:
case QXL_IO_FLUSH_SURFACES_ASYNC:
async_common:
async = QXL_ASYNC;
@@ -1502,6 +1523,9 @@ async_common:
d->mode = QXL_MODE_UNDEFINED;
qxl_spice_destroy_surfaces(d, async);
break;
+ case QXL_IO_MONITORS_CONFIG_ASYNC:
+ qxl_spice_monitors_config_async(d);
+ break;
default:
qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
}
@@ -1818,6 +1842,10 @@ static int qxl_init_common(PCIQXLDevice *qxl)
io_size = 16;
break;
case 3: /* qxl-3 */
+ pci_device_rev = QXL_REVISION_STABLE_V10;
+ io_size = 24;
+ break;
+ case 4: /* qxl-4 */
default:
pci_device_rev = QXL_DEFAULT_REVISION;
io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);