X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=hw%2Fdisplay%2Fqxl.c;h=84f99088e0a01b279e1c72b3125f2f7193bf7bde;hb=561d0f456824e7dd38f25acf14014975e740e130;hp=11871340e75d4260293de58008d2386d9644201e;hpb=d0cc248164961a7ba9d43806feffd76f9f6d7f41;p=mirror_qemu.git diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 11871340e7..84f99088e0 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -321,7 +321,7 @@ static ram_addr_t qxl_rom_size(void) #define QXL_ROM_SZ 8192 QEMU_BUILD_BUG_ON(QXL_REQUIRED_SZ > QXL_ROM_SZ); - return QXL_ROM_SZ; + return QEMU_ALIGN_UP(QXL_REQUIRED_SZ, qemu_real_host_page_size); } static void init_qxl_rom(PCIQXLDevice *d) @@ -944,7 +944,7 @@ static void interface_async_complete_io(PCIQXLDevice *qxl, QXLCookie *cookie) qxl_spice_destroy_surface_wait_complete(qxl, cookie->u.surface_id); break; default: - fprintf(stderr, "qxl: %s: unexpected current_async %d\n", __func__, + fprintf(stderr, "qxl: %s: unexpected current_async %u\n", __func__, current_async); } qxl_send_events(qxl, QXL_INTERRUPT_IO_CMD); @@ -1908,7 +1908,7 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events) /* * Older versions of Spice forgot to define the QXLRam struct * with the '__aligned__(4)' attribute. clang 7 and newer will - * thus warn that atomic_fetch_or(&d->ram->int_pending, ...) + * thus warn that qatomic_fetch_or(&d->ram->int_pending, ...) * might be a misaligned atomic access, and will generate an * out-of-line call for it, which results in a link error since * we don't currently link against libatomic. @@ -1928,7 +1928,7 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events) #define ALIGNED_UINT32_PTR(P) ((uint32_t *)P) #endif - old_pending = atomic_fetch_or(ALIGNED_UINT32_PTR(&d->ram->int_pending), + old_pending = qatomic_fetch_or(ALIGNED_UINT32_PTR(&d->ram->int_pending), le_events); if ((old_pending & le_events) == le_events) { return; @@ -1992,7 +1992,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl) } } -static void qxl_vm_change_state_handler(void *opaque, int running, +static void qxl_vm_change_state_handler(void *opaque, bool running, RunState state) { PCIQXLDevice *qxl = opaque; @@ -2266,6 +2266,7 @@ static void qxl_realize_secondary(PCIDevice *dev, Error **errp) qxl->vga.vram_size, &error_fatal); qxl->vga.vram_ptr = memory_region_get_ram_ptr(&qxl->vga.vram); qxl->vga.con = graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl); + qxl->ssd.dcl.con = qxl->vga.con; qxl->id = qemu_console_get_index(qxl->vga.con); /* == channel_id */ qxl_realize_common(qxl, errp); @@ -2383,7 +2384,7 @@ static bool qxl_monitors_config_needed(void *opaque) } -static VMStateDescription qxl_memslot = { +static const VMStateDescription qxl_memslot = { .name = "qxl-memslot", .version_id = QXL_SAVE_VERSION, .minimum_version_id = QXL_SAVE_VERSION, @@ -2395,7 +2396,7 @@ static VMStateDescription qxl_memslot = { } }; -static VMStateDescription qxl_surface = { +static const VMStateDescription qxl_surface = { .name = "qxl-surface", .version_id = QXL_SAVE_VERSION, .minimum_version_id = QXL_SAVE_VERSION, @@ -2413,7 +2414,7 @@ static VMStateDescription qxl_surface = { } }; -static VMStateDescription qxl_vmstate_monitors_config = { +static const VMStateDescription qxl_vmstate_monitors_config = { .name = "qxl/monitors-config", .version_id = 1, .minimum_version_id = 1, @@ -2424,7 +2425,7 @@ static VMStateDescription qxl_vmstate_monitors_config = { }, }; -static VMStateDescription qxl_vmstate = { +static const VMStateDescription qxl_vmstate = { .name = "qxl", .version_id = QXL_SAVE_VERSION, .minimum_version_id = QXL_SAVE_VERSION, @@ -2521,6 +2522,7 @@ static const TypeInfo qxl_primary_info = { .parent = TYPE_PCI_QXL, .class_init = qxl_primary_class_init, }; +module_obj("qxl-vga"); static void qxl_secondary_class_init(ObjectClass *klass, void *data) { @@ -2537,6 +2539,7 @@ static const TypeInfo qxl_secondary_info = { .parent = TYPE_PCI_QXL, .class_init = qxl_secondary_class_init, }; +module_obj("qxl"); static void qxl_register_types(void) { @@ -2546,3 +2549,5 @@ static void qxl_register_types(void) } type_init(qxl_register_types) + +module_dep("ui-spice-core");