summaryrefslogtreecommitdiff
path: root/hw/qxl.c
AgeCommit message (Collapse)AuthorFilesLines
2012-06-22vga: raise default vgamem sizeGerd Hoffmann1-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>
2012-06-22qxl: add vgamem_size_mb and vgamem_sizeAlon Levy1-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>
2012-06-22vga: make vram size configurableGerd Hoffmann1-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>
2012-06-22qxl: reset current_async on qxl_soft_resetAlon Levy1-0/+1
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-22hw/qxl: ignore guest from guestbug until resetAlon Levy1-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>
2012-06-22qxl: stop dirty loging when not in vga modeAlon Levy1-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>
2012-06-22hw/qxl: s/qxl_guest_bug/qxl_set_guest_bug/Alon Levy1-22/+27
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-14qxl: set size of PCI IO BAR correctly (16) for revision 2Uri Lublin1-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>
2012-05-03qxl: don't assert on guest create_guest_primaryAlon Levy1-1/+4
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03qxl: ioport_write: remove guest trigerrable abortAlon Levy1-2/+1
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03qxl: qxl_add_memslot: remove guest trigerrable panicsAlon Levy1-7/+20
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03qxl: interface_notify_update: remove guest trigerrable abortAlon Levy1-2/+7
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03qxl: cleanup s/__FUNCTION__/__func__/Alon Levy1-1/+1
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03qxl: don't abort on guest trigerrable ring indices mismatchAlon Levy1-12/+39
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03qxl: fix > 80 chars lineAlon Levy1-2/+2
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03qxl: replace panic with guest bug in qxl_track_commandAlon Levy1-1/+5
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03qxl: check for NULL return from qxl_phys2virtAlon Levy1-1/+12
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03hw/qxl.c: qxl_phys2virt: replace panics with guest_bugAlon Levy1-6/+19
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-20qxl: Add missing GCC_FMT_ATTR and fix format specifierStefan Weil1-1/+1
val is an uint64_t, therefore %d was not correct. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18qxl: set default values of vram*_size_mb to -1Alon Levy1-2/+2
The addition of those values caused a regression where not specifying any value for the vram bar size would result in a 4096 _byte_ surface area. This is ok for the windows driver but causes the X driver to be unusable. Also, it's a regression. This patch returns the default behavior of having a 64 megabyte vram BAR. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19hw/qxl.c: Fix compilation failures on 32 bit hostsPeter Maydell1-8/+8
Fix compilation failures on 32 bit hosts (cast from pointer to integer of different size; %ld expects 'long int' not uint64_t). Reported-by: Steve Langasek <steve.langasek@canonical.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19qxl: switch qxl.c to trace-eventsAlon Levy1-72/+69
dprint is still used for qxl_init_common one time prints. also switched parts of spice-display.c over, mainly all the callbacks to spice server. All qxl device trace events start with the qxl device id. Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19qxl: init_pipe_signaling: exit on failureAlon Levy1-10/+11
If pipe creation fails, exit, don't log and continue. Fix indentation at the same time. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-28qxl: add optinal 64bit vram barGerd Hoffmann1-7/+44
This patch adds an 64bit pci bar for vram. It is turned off by default. It can be enabled by setting the size of the 64bit bar to be larger than the 32bit bar. Both 32bit and 64bit bar refer to the same memory. Only the first part of the memory is available via 32bit bar. The intention is to allow large vram sizes for 64bit guests, by allowing the vram bar being mapped above 4G, so we don't have to squeeze it into the pci I/O window below 4G. With vram_size_mb=16 and vram64_size_mb=256 it looks like this: 00:02.0 VGA compatible controller: Red Hat, Inc. Device 0100 (rev 02) (prog-if 00 [VGA controller]) Subsystem: Red Hat, Inc Device 1100 Physical Slot: 2 Flags: fast devsel, IRQ 10 Memory at f8000000 (32-bit, non-prefetchable) [size=64M] Memory at fc000000 (32-bit, non-prefetchable) [size=16M] Memory at fd020000 (32-bit, non-prefetchable) [size=8K] I/O ports at c5a0 [size=32] Memory at ffe0000000 (64-bit, prefetchable) [size=256M] Expansion ROM at fd000000 [disabled] [size=64K] [ mapping above 4G needs patched seabios: http://www.kraxel.org/cgit/seabios/commit/?h=pci64 ]
2012-02-27qxl: make qxl_render_update asyncAlon Levy1-4/+65
RHBZ# 747011 Removes the last user of QXL_SYNC when using update drivers that use the _ASYNC io ports. The last user is qxl_render_update, it is called both by qxl_hw_update which is the vga_hw_update_ptr passed to graphic_console_init, and by qxl_hw_screen_dump. At the same time the QXLRect area being passed to the red_worker thread is passed as a copy, as part of the QXLCookie. The implementation uses interface_update_area_complete with a bh to make sure dpy_update and qxl_flip are called from the io thread, otherwise the vga->ds->surface.data can change under our feet. With this patch sdl+spice works fine. But spice by itself doesn't produce the expected screendumps unless repeated a few times, due to ppm_save being called before update_area (rendering done in spice server thread) having a chance to complete. Fixed by next patch, but see commit message for problem introduced by it. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27qxl: introduce QXLCookieAlon Levy1-14/+47
Will be used in the next patch. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27qxl: require spice >= 0.8.2Alon Levy1-40/+0
drop all ifdefs on SPICE_INTERFACE_QXL_MINOR >= 1 as a result, any check for SPICE_SERVER_VERSION that is now always satisfied, and SPICE_INTERFACE_CORE_MINOR >= 3 tests, because 0.8.2 has SPICE_INTERFACE_QXL_MINOR == 1 and SPICE_INTERFACE_CORE_MINOR == 3. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27qxl: fix spice+sdl no cursor regressionAlon Levy1-0/+4
regression introduced by 075360945860ad9bdd491921954b383bf762b0e5, v2: lock around qemu_spice_cursor_refresh_unlocked Reported-by: Fabiano Fidêncio <fabiano@fidencio.org> Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-24optimize screendump for the common non-switch caseGerd Hoffmann1-2/+2
switch console only if needed, also pass down whenever the console was switched or not because a displaysurface redraw is only needed in case the console was switched. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-21qxl: add user-friendly bar size propertiesGerd Hoffmann1-0/+8
Add two properties to specify bar sizes in megabytes instead of bytes, which is alot more user-friendly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: move ram size init to new functionGerd Hoffmann1-19/+22
Factor memory bar sizing bits out to a separate function. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: drop vram bar minimum sizeGerd Hoffmann1-2/+2
There is no reason to require a minimum size of 16 MB for the vram. Lower the limit to 4096 (one page). Make it disapper completely would break guests.
2012-02-21qxl: make sure primary surface is saved on migration also in compat modeYonit Halperin1-1/+1
RHBZ #790083 Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: set only off-screen surfaces dirty instead of the whole vramYonit Halperin1-9/+44
We used to assure the guest surfaces were saved before migration by setting the whole vram dirty. This patch sets dirty only the areas that are actually used in the vram. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: fix warnings on 32bitGerd Hoffmann1-3/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-15qom: Unify type registrationAndreas Färber1-2/+2
Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qdev: register all types natively through QEMU Object ModelAnthony Liguori1-18/+22
This was done in a mostly automated fashion. I did it in three steps and then rebased it into a single step which avoids repeatedly touching every file in the tree. The first step was a sed-based addition of the parent type to the subclass registration functions. The second step was another sed-based removal of subclass registration functions while also adding virtual functions from the base class into a class_init function as appropriate. Finally, a python script was used to convert the DeviceInfo structures and qdev_register_subclass functions to TypeInfo structures, class_init functions, and type_register_static calls. We are almost fully converted to QOM after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27pci: convert to QEMU Object ModelAnthony Liguori1-24/+38
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: prepare source tree for code conversionAnthony Liguori1-4/+4
These are various small stylistic changes which help make things more consistent such that the automated conversion script can be simpler. It's not necessary to agree or disagree with these style changes because all of this code is going to be rewritten by the patch monkey script anyway. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-25memory: change dirty setting APIs to take a sizeBlue Swirl1-4/+1
Instead of each target knowing or guessing the guest page size, just pass the desired size of dirtied memory area. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-17qxl: Slot sanity check in qxl_phys2virt() is off by one, fixMarkus Armbruster1-1/+1
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-04vmstate, memory: decouple vmstate from memory APIAvi Kivity1-6/+6
Currently creating a memory region automatically registers it for live migration. This differs from other state (which is enumerated in a VMStateDescription structure) and ties the live migration code into the memory core. Decouple the two by introducing a separate API, vmstate_register_ram(), for registering a RAM block for migration. Currently the same implementation is reused, but later it can be moved into a separate list, and registrations can be moved to VMStateDescription blocks. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-07qxl: fix vga port initialization.Gerd Hoffmann1-5/+17
Commit 0a039dc70096b768d3810afa50ba1d214768aaf4 broke vga modes for qxl-vga by loosing vga_ioport_read windup. qxl needs to hook into vga port writes only and used to realize that by letting vga_init() do the work for both reads and writes, then overwrite the write function. That little detail was missed while doing the conversion ... This patch fixes it. It also switch qxl vga ioport registration to portio lists while being at it. Cc: Hans de Goede <hdegoede@redhat.com> Acked-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01qxl: create slots on post_load in vga stateAlon Levy1-7/+19
RHBZ 740547 If we migrate when the device is in vga state the guest still believes the slots are created, and will cause operations that reference the slots, causing a "panic: virtual address out of range" on the first of them. Easy to see by migrating in vga mode with a driver loaded, for instance windows cmd window in full screen mode, and then exiting vga mode back to native mode will cause said panic. Fixed by doing the slot recreation in post_load for vga mode as well. Note that compat does not require any changes because it creates it's only slot by a side effect of QXL_IO_SET_MODE. Signed-off-by: Alon Levy <alevy@redhat.com>
2011-10-25qxl: reset update_surfaceAlon Levy1-0/+1
update init_qxl_ram to reset update_surface to 0. This fixes one case of breakage when installing an old driver in a vm that had a new driver installed. The newer driver would know about surface creation and would change update_surface to !=0, then a reset would happen, all surfaces are destroyed, then the old driver is initialized and issues an UPDATE_AREA, and spice server aborts on invalid surface. RHBZ: 690427 Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-25qxl: fix guest cursor trackingYonit Halperin1-4/+12
(1) If the guest cursor command is empty, don't reload it after migration. (2) Cleaning the guest cursor when it is released by the spice server. In addition, explicitly reset the cursor in spice upon destroying the primary surface (was done by spice-server implicitly). This will prevent access to pci memory that was released. RHBZ: 744518 Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-25qxl: factor out propertiesGerd Hoffmann1-24/+15
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-25qxl: Drop phread_yield on OOMJan Kiszka1-6/+0
This was only a best-effort attempt, by far not guaranteed to have an effect. Drop it so that also no direct pthread usage remain in the device model. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-25qxl: Convert to QEMU thread APIJan Kiszka1-2/+2
Use QEMU thread API instead of pthread directly. We still need to get rid of pthread_yield, though, to drop pthread.h inclusion. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-11vga: Convert to isa_register_portio_listRichard Henderson1-1/+1
[jan: fix cut'n'paste errors] [avi: adjust pci variants not to use isa functions] Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>