summaryrefslogtreecommitdiffstats
path: root/hw/qxl.c
Commit message (Collapse)AuthorAgeFilesLines
* qxl: change rom size to 8192Alon Levy2013-01-221-6/+7
| | | | | | | | | | | | | | | | | | | | | This is a simpler solution to 869981, where migration breaks since qxl's rom bar size has changed. Instead of ignoring fields in QXLRom, which is what has actually changed, we remove some of the modes, a mechanism already accounted for by the guest. The modes left allow for portrait and landscape only modes, corresponding to orientations 0 and 1. Orientations 2 and 3 are dropped. Added assert so that rom size will fit the future QXLRom increases via spice-protocol changes. This patch has been tested with 6.1.0.10015. With the newer 6.1.0.10016 there are problems with both "(flipped)" modes prior to the patch, and the patch loses the ability to set "Portrait" modes. But this is a separate bug to be fixed in the driver, and besides the patch doesn't affect the new arbitrary mode setting functionality. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: stop using non revision 4 rom fields for revision < 4Alon Levy2013-01-221-0/+11
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: Don't drop client capability bitsMarkus Armbruster2013-01-141-2/+4
| | | | | | | | | | | | | | interface_set_client_capabilities() copies only the first few bits, because it falls into a Classic C trap: you can declare a parameter uint8_t caps[58], but the resulting parameter type is uint8_t *, not uint8_t[58]. In particular, sizeof(caps) is sizeof(uint8_t *), not the intended sizeof(uint8_t[58]). Harmless, because the bits aren't used, yet. Broken in commit c10018d6. Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: Fix SPICE_RING_PROD_ITEM(), SPICE_RING_CONS_ITEM() sanity checkMarkus Armbruster2013-01-141-14/+6
| | | | | | | | | The pointer arithmetic there is safe, but ugly. Coverity grouses about it. However, the actual comparison is off by one: <= end instead of < end. Fix by rewriting the check in a cleaner way. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Make all static TypeInfos constAndreas Färber2013-01-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all types natively through QEMU Object Model), TypeInfo as used in the common, non-iterative pattern is no longer amended with information and should therefore be const. Fix the documented QOM examples: sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h Since frequently the wrong examples are being copied by contributors of new devices, fix all types in the tree: sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c This also avoids to piggy-back these changes onto real functional changes or other refactorings. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* softmmu: move include files to include/sysemu/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* misc: move include files to include/qemu/Paolo Bonzini2012-12-191-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* monitor: move include files to include/monitor/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qxl: reload memslots after migration, when qxl is in UNDEFINED modeYonit Halperin2012-11-291-0/+1
| | | | | | | | | | | The devram memslot stays active when qxl enters UNDEFINED mode (i.e, no primary surface). If migration has occurred while the device is in UNDEFINED stae, the memslots have to be reloaded at the destination. Fixes rhbz#874574 Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: fix initialization orderGerd Hoffmann2012-11-051-2/+8
| | | | | | | | | | Register displaychangelistener last, after spice is fully initialized, otherwise we may hit NULL pointer dereferences when qemu starts calling our callbacks. Commit e250d949feb1334828f27f0d145c35f29c4b7639 triggers this bug. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: call dpy_gfx_resize when entering vga modeGerd Hoffmann2012-11-051-1/+1
| | | | | | | | | | | | | | | When entering vga mode the display size likely changes, notify all displaychangelisteners about this. Probably went unnoticed for a while as one if the first things the guest does after leaving qxl native mode and entering qxl vga mode is to set the vga video mode. But there is still a small window where qemu can operate on stale data, leading to crashes now and then. https://bugzilla.redhat.com/show_bug.cgi?id=865767 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: fix cursor resetGerd Hoffmann2012-11-051-0/+4
| | | | | | When resetting the qxl cursor notify the qemu displaystate too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/qxl: qxl_send_events: nop if stoppedAlon Levy2012-11-051-1/+7
| | | | | | | | | Added a trace point for easy logging. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=870972 Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/qxl: guest bug on primary create with stride %4 != 0Alon Levy2012-11-051-0/+12
| | | | | | | | | | | | | | | Due to usage of pixman for rendering on all spice surfaces we have pixman's requirement that the stride be word aligned. A guest not honoring that can crash spice and qemu with it due to failure to create a surface (in spice-server). Avoid this early on in primary surface creation and offscreen surface creation. Recently windows guests got odd width support which triggers a non word aligned primary surface in 16bit color depth. Off screen surfaces have always been word aligned, but doesn't hurt to check them here too. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: untangle gfx & txt updatesGerd Hoffmann2012-11-011-2/+2
| | | | | | | | | | | | | | | | Stop abusing displaysurface fields for text mode displays. (bpp = 0, width = cols, height = lines). Add flags to displaystate indicating whenever text mode display (curses) or gfx mode displays (sdl, vnc, ...) are present. Add separate displaychangelistener callbacks for text / gfx mode resize & updates. This allows to enable gfx and txt diplays at the same time and also paves the way for more cleanups in the future. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Rename target_phys_addr_t to hwaddrAvi Kivity2012-10-231-2/+2
| | | | | | | | | | | | | | | target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* spice: raise requirement to 0.12Gerd Hoffmann2012-10-081-30/+0
| | | | | | | | | | | | With the next qemu version (1.3) we are going to bump the qxl device revision to 4. The new features available require a recent spice-server version, so raise up the bar. Otherwise we would end up with different qxl revisions depending on the spice-server version installed, which would be a major PITA when it comes to compat properties. Clear out a big bunch of #ifdefs which are not needed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/qxl: qxl_dirty_surfaces: use uintptr_tAlon Levy2012-10-081-2/+2
| | | | | | | As suggested by Paolo Bonzini, to avoid possible integer overflow issues. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/qxl: fix condition for exiting guest_bugAlon Levy2012-10-081-1/+1
| | | | | | | Reported and suggested by Paolo Bonzini, thanks. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/qxl: exit on failure to register qxl interfaceAlon Levy2012-10-081-1/+5
| | | | | | | | | This prevents a segfault later on when the device reset handler tries to access a NULL ssd.worker since interface_attach_worker has not been called. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: fix range check for rev3 io commands.Gerd Hoffmann2012-10-081-1/+1
| | | | | | | Enables QXL_IO_FLUSH_SURFACES_ASYNC and QXL_IO_FLUSH_RELEASE which are part of the qxl rev3 feature set. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl/update_area_io: cleanup invalid parameters handlingMichael Tokarev2012-10-081-10/+3
| | | | | | | | | | | This cleans up two additions of almost the same code in commits 511b13e2c9 and ccc2960d654. While at it, make error paths consistent (always use 'break' instead of 'return'). Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Cc: Dunrong Huang <riegamaths@gmail.com> Cc: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge remote-tracking branch 'spice/spice.v60' into stagingAnthony Liguori2012-09-171-6/+101
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * spice/spice.v60: hw/qxl: support client monitor configuration via device qxl: add trace-event for QXL_IO_LOG hw/qxl: tracing fixes qxl: better cleanup for surface destroy qxl: Ignore set_client_capabilities pre/post migrate qxl: dont update invalid area spice: send updates only for changed screen content spice: add screen mirror spice: split qemu_spice_create_update spice: switch to queue for vga mode updates
| * hw/qxl: support client monitor configuration via deviceAlon Levy2012-09-131-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now we used only the agent to change the monitor count and each monitor resolution. This patch introduces the qemu part of using the device as the mediator instead of the agent via virtio-serial. Spice (>=0.11.5) calls the new QXLInterface::client_monitors_config, which returns wether the interrupt is enabled, and if so and given a non NULL monitors config will generate an interrupt QXL_INTERRUPT_CLIENT_MONITORS_CONFIG with crc checksum for the guest to verify a second call hasn't interfered. The maximal number of monitors is limited on the QXLRom to 64. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * qxl: add trace-event for QXL_IO_LOGAlon Levy2012-09-131-0/+1
| | | | | | | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * hw/qxl: tracing fixesAlon Levy2012-09-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new trace events: qxl_send_events(int qid, uint32_t events) "%d %d" qxl_set_guest_bug(int qid) "%d" Change qxl_io_unexpected_vga_mode parameters to be equivalent to those of qxl_io_write for easier grouping under a single systemtap probe. Change d to qxl in one place. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * qxl: better cleanup for surface destroyUri Lublin2012-09-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | Add back a call to qxl_spice_destroy_surface_wait_complete() in qxl_spice_destroy_surface_wait(), that was removed by commit c480bb7da465186b84d8427e068ef7502e47ffbf It is needed to complete surface-removal cleanup, for non async. For async, qxl_spice_destroy_surface_wait_complete is called upon operation completion. Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * qxl: Ignore set_client_capabilities pre/post migrateHans de Goede2012-09-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent introduction of set_client_capabilities has broken (seamless) migration by trying to call qxl_send_events pre (seamless incoming) and post (*) migration, triggering the following assert: qxl_send_events: Assertion `qemu_spice_display_is_running(&d->ssd)' failed. The solution is easy, pre migration the guest will have already received the client caps on the migration source side, and post migration there no longer is a guest, so we can simply ignore the set_client_capabilities call in both those scenarios. *) Post migration, so not fatal for to the migration itself, but still a crash Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * qxl: dont update invalid areaDunrong Huang2012-09-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following error: $ ~/usr/bin/qemu-system-x86_64 -enable-kvm -m 1024 -spice port=5900,disable-ticketing -vga qxl -cdrom ~/Images/linuxmint-13-mate-dvd-32bit.iso (/home/mathslinux/usr/bin/qemu-system-x86_64:10068): SpiceWorker-CRITICAL **: red_worker.c:4599:red_update_area: condition `area->left >= 0 && area->top >= 0 && area->left < area->right && area->top < area->bottom' failed Aborted spice server terminates QEMU process if we pass invalid area to it, so dont update those invalid areas. Signed-off-by: Dunrong Huang <riegamaths@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * spice: switch to queue for vga mode updatesGerd Hoffmann2012-09-121-3/+3
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | VGA: Flush coalesced MMIO on related MMIO/PIO accessesJan Kiszka2012-09-111-0/+1
|/ | | | | | | | | | In preparation of stopping to flush coalesced MMIO unconditionally on vmexits, mark VGA MMIO and PIO regions as synchronous /wrt coalesced MMIO and flush the buffer explicitly on PIO accesses that do not use generic memory regions yet. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Merge branch 'spice.v59' of git://anongit.freedesktop.org/spice/qemuAurelien Jarno2012-09-101-23/+152
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'spice.v59' of git://anongit.freedesktop.org/spice/qemu: Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP qxl: Add set_client_capabilities() interface to QXLInterface spice: make number of surfaces runtime-configurable. configure: print spice-protocol and spice-server versions qxl: add QXL_IO_MONITORS_CONFIG_ASYNC qxl: disallow unknown revisions qxl/update_area_io: guest_bug on invalid parameters spice: increase the verbosity of spice section in "qemu --help" spice: adding seamless-migration option to the command line spice: add 'migrated' flag to spice info spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED spice: notify on vm state change only via spice_server_vm_start/stop spice: notify spice server on vm start/stop spice: abort on invalid streaming cmdline params
| * Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPPSøren Sandmann Pedersen2012-09-051-2/+0
| | | | | | | | | | | | | | We require spice >= 0.8 now, so this flag is always present. Signed-off-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * qxl: Add set_client_capabilities() interface to QXLInterfaceSøren Sandmann Pedersen2012-09-051-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This new interface lets spice server inform the guest whether (a) a client is connected (b) what capabilities the client has There is a fixed number (464) of bits reserved for capabilities, and when the capabilities bits change, the QXL_INTERRUPT_CLIENT interrupt is generated. Signed-off-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * spice: make number of surfaces runtime-configurable.Gerd Hoffmann2012-09-051-14/+17
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * qxl: add QXL_IO_MONITORS_CONFIG_ASYNCAlon Levy2012-09-051-4/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revision bumped to 4 for new IO support, enabled for spice-server >= 0.11.1. New io enabled if revision is 4. Revision can be set to 4. [ kraxel: 3 continues to be the default revision. Once we have a new stable spice-server release and the qemu patches to enable the new bits merged we'll go flip the switch and make rev4 the default ] This io calls the corresponding new spice api spice_qxl_monitors_config_async to let spice-server read a new guest set monitors config and notify the client. On migration reissue spice_qxl_monitors_config_async. RHBZ: 770842 Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> fixup Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * qxl: disallow unknown revisionsAlon Levy2012-09-051-1/+4
| | | | | | | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * qxl/update_area_io: guest_bug on invalid parametersAlon Levy2012-09-051-0/+12
| | | | | | | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * spice: notify on vm state change only via spice_server_vm_start/stopYonit Halperin2012-09-051-3/+4
| | | | | | | | | | | | | | QXLWorker->start/stop are deprecated since spice-server 0.11.2 Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | vga: ppm_save(): add error handlingLuiz Capitulino2012-09-051-1/+1
| | | | | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | console: vga_hw_screen_dump_ptr: take Error argumentLuiz Capitulino2012-09-051-2/+3
|/ | | | | | | | | | | | | All devices that register a screen dump callback via graphic_console_init() are updated. The new argument is not used in this commit. Error handling will be added to each device individually later. This change is a preparation to convert the screendump command to the QAPI. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* vga: raise default vgamem sizeGerd Hoffmann2012-06-221-1/+1
| | | | | | | | | | Old size: 8 MB (traditional upstream qemu value). New size: 16 MB (traditional qemu-kvm value). Also adds compat properties so old machine types keep the old default values. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: add vgamem_size_mb and vgamem_sizeAlon Levy2012-06-221-30/+42
| | | | | | | | | | | | In preperation for supporting a larger framebuffer for multiple monitors on a single card, add a property to qxl vgamem_size_mb, and corresponding byte sized vgamem_size, and use instead of VGA_RAM_SIZE. [ kraxel: simplify property handling, add sanity checks ] [ kraxel: fix mode copying ] Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vga: make vram size configurableGerd Hoffmann2012-06-221-1/+4
| | | | | | | | | | | | | | | | | Zap the global VGA_RAM_SIZE #define, make the vga ram size configurable for standard vga and vmware vga. cirrus and qxl are left with a fixed size (and private VGA_RAM_SIZE #define) for now. qxl needs some non-trivial adjustments in the mode list handling deal with a runtime-configurable size, which calls for a separate qxl patch. cirrus emulates cards which have 2 MB (isa) and 4 MB (pci), so I guess it would make sense to use these sizes. That change would break migration though, so I left it fixed at 8 MB size. Making it configurabls is pretty pointless for cirrus as we have to match real hardware. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: reset current_async on qxl_soft_resetAlon Levy2012-06-221-0/+1
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/qxl: ignore guest from guestbug until resetAlon Levy2012-06-221-1/+12
| | | | | | | | | | soft_reset is called from any of: * QXL_IO_RESET * vga io * pci reset handler Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: stop dirty loging when not in vga modeAlon Levy2012-06-221-0/+2
| | | | | | | | | | Tested with linux guest. Not sure how to check actual performance affect of this. Checked with the previously send traceevent that the kvm ioctl to start/stop dirty logging is being called. (KVM_SET_USER_MEMORY_REGION). Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/qxl: s/qxl_guest_bug/qxl_set_guest_bug/Alon Levy2012-06-221-22/+27
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: set size of PCI IO BAR correctly (16) for revision 2Uri Lublin2012-05-141-5/+3
| | | | | | | Also move it up into switch(qxl->revision) block Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qxl: don't assert on guest create_guest_primaryAlon Levy2012-05-031-1/+4
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud