aboutsummaryrefslogtreecommitdiffstats
path: root/hw/vga.c
AgeCommit message (Collapse)AuthorFilesLines
2012-02-24optimize screendump for the common non-switch caseGerd Hoffmann1-4/+6
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-24vga: simplify screendumpGerd Hoffmann1-35/+1
The displaychangelistener isn't needed at all, we can simply save the image when vga_hw_update is done instead of hooking into the update process. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-11vga: Fix full updates in graphic modeJan Kiszka1-2/+3
This fixes the regression introduced by cd7a45c95e: We lost the or'ing with the full_update flag. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-11Fix memory dirty getting API change falloutBlue Swirl1-1/+1
Fix confusion in length calculation in commit cd7a45c95ecf2404810f3c6becb7cb83c5010ad8. Reported-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-04vga: improve documentationBlue Swirl1-0/+12
Add links to chipset docs and FreeVGA site. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-04vga: use constants from vga.hBlue Swirl1-168/+194
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-02-04memory: change dirty getting API to take a sizeBlue Swirl1-12/+5
Instead of each device 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-25memory: change dirty setting APIs to take a sizeBlue Swirl1-3/+3
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-12vga: optimize ppm_save() divisionsAvi Kivity1-6/+4
ppm_save() spends upwards of 50% of its time doing divisions. Replace them with shifts. Reviewed-by: Alon Levy <alevy@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-04vmstate, memory: decouple vmstate from memory APIAvi Kivity1-1/+2
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-12-20xen, vga: add API for registering the framebufferAvi Kivity1-0/+2
Xen currently uses the name of a memory region to determine whether it is the framebuffer. Replace with an explicit API. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-15Move graphic-related coalesced MMIO flushes to affected device modelsJan Kiszka1-0/+4
This is conceptually cleaner and will allow us to drop the nographic timer. Moreover, it will be mandatory to fully exploit future per-device coalesced MMIO rings. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-11vga: Convert to isa_register_portio_listRichard Henderson1-31/+42
[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>
2011-09-16vga: Respect isa_mem_base when registering chain4 aliasJan Kiszka1-0/+1
This does not yet unbreak PPC (which has its own problems) but potentially other non-x86 systems where isa_mem_base is != 0. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-16vga: Fix text mode screendumpsJan Kiszka1-4/+3
In text mode, even a full refresh of the screen takes multiple updates. As we reset the dump file pointer after the first call, we only wrote the first line. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-25vga: Silence bogus gcc warning about uninitialized variablesJan Kiszka1-0/+1
Some gcc versions do not properly detect that all possible cases are covered and base and size are always initialized. Please gcc by defining a pseudo default case. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22vga: Use linear mapping + dirty logging in chain 4 memory access modeJan Kiszka1-1/+50
Most VGA memory access modes require MMIO handling as they demand weird logic to get a byte from or into the video RAM. However, there is one exception: chain 4 mode with all memory planes enabled for writing. This mode actually allows lineary mapping, which can then be combined with dirty logging to accelerate KVM. This patch accelerates specifically VBE accesses like they are used by grub in graphical mode. Not only the standard VGA adapter benefits from this, also vmware and spice in VGA mode. CC: Gerd Hoffmann <kraxel@redhat.com> CC: Avi Kivity <avi@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22vmware-vga: Eliminate vga_dirty_log_restartJan Kiszka1-6/+0
After the conversion to the new Memory API, vga_dirty_log_restart became seriously pointless. Remove it from vmware-vga and and then finally drop the service. CC: Andrzej Zaborowski <balrogg@gmail.com> CC: Avi Kivity <avi@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22vga: drop get_system_memory() from vga devices and derivativesAvi Kivity1-5/+4
Instead, use the bus accessors, or get the address space directly from the board constructor. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori1-4/+4
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-08vga: simplify vga window mmio access functionsAvi Kivity1-48/+8
Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. We have to keep vga_mem_{read,write}b() since they're used by cirrus. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-08vga: convert vga and its derivatives to the memory APIAvi Kivity1-79/+67
Convert all vga memory to the memory API. Note we need to fall back to get_system_memory(), since the various buses don't pass the vga window as a memory region. We no longer need to sync the dirty bitmap of the cirrus mapped memory banks, since the memory API takes care of that for us. [jan: fix vga-pci logging] Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-22Optimize screendumpAvi Kivity1-3/+10
When running kvm-autotest, fputc() is often the second highest (sometimes #1) function showing up in a profile. This is due to fputc() locking the file for every byte written. Optimize by buffering a line's worth of pixels and writing that out in a single call. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-21change all other clock references to use nanosecond resolution accessorsPaolo Bonzini1-1/+1
This was done with: sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. There was exactly one false positive in qemu_run_timers: - current_time = qemu_get_clock (clock); + current_time = qemu_get_clock_ns (clock); which is of course not in this patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-02-20vga-isa: convert to qdevBlue Swirl1-8/+14
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-14Introduce log_start/log_stop in CPUPhysMemoryClientAnthony PERARD1-15/+16
In order to use log_start/log_stop with Xen as well in the vga code, this two operations have been put in CPUPhysMemoryClient. The two new functions cpu_physical_log_start,cpu_physical_log_stop are used in hw/vga.c and replace the kvm_log_start/stop. With this, vga does no longer depends on kvm header. [ Jan: rebasing and style fixlets ] Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-04Fix curses on big endian hostsAurelien Jarno1-3/+3
On big endian hosts, the curses interface is unusable: the emulated graphic card only displays garbage, while the monitor interface displays nothing (or rather only spaces). The curses interface is waiting for data in native endianness, so console_write_ch() should not do any conversion. The conversion should be done when reading the video buffer in hw/vga.c. I supposed this buffer is in little endian mode, though it's not impossible that the data is actually in guest endianness. I currently have no big endian guest to way (they all switch to graphic mode immediately). Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-12-19vga: Declare as little endianBlue Swirl1-25/+1
This patch replaces explicit bswaps with endianness hints to the mmio layer. CC: Alexander Graf <agraf@suse.de> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add endianness as io mem parameterAlexander Graf1-1/+2
As stated before, devices can be little, big or native endian. The target endianness is not of their concern, so we need to push things down a level. This patch adds a parameter to cpu_register_io_memory that allows a device to choose its endianness. For now, all devices simply choose native endian, because that's the same behavior as before. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-11-16more stdvga cleanups.Gerd Hoffmann1-2/+0
video.x is gone now. It was the only user of the vga bios_offset + bios_size logic. Zap it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-08-22VGA: Don't register deprecated VBE rangeAlex Williamson1-7/+0
Old versions of the BOCHs VGA BIOS (cira 2003) made use of VBE registers at 0xff80/81. In VBE API version 0xb0c2 these were moved to 0x1ce/cf. Unfortunately, QEMU still registers handlers for the old range. If a guest attempts to assign an I/O device overlapping this region, QEMU exits with a hw_error. Windows guests seem to like to assign I/O devices to the high end of the address space, so it's pretty easy to hot add an rtl8139 to a Win2k8 guest and trigger the bug. I can't find any reason to register these handlers, so let's remove the cruft. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-06qemu_ram_alloc: Add DeviceState and name parametersAlex Williamson1-1/+1
These will be used to generate unique id strings for ramblocks. The name field is required, the device pointer is optional as most callers don't have a device. When there's no device or the device isn't a child of a bus implementing BusInfo.get_dev_path, the name should be unique for the platform. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-22Fix %lld or %llx printf format useBlue Swirl1-1/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-14vga: make some tables 'const'Blue Swirl1-5/+5
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-28vga: fix typo in length passed to kvm_log_stopMarcelo Tosatti1-2/+2
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-04-25x86: remove dead assignments, spotted by clang analyzerBlue Swirl1-3/+6
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-08update bochs vbe interfaceGerd Hoffmann1-2/+4
The bochs vbe interface got a new register a while back, which specifies the linear framebuffer size in 64k units. This patch adds support for the new register to qemu. With this patch applied vgabios 0.6c works with qemu. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-01-13hw/vga.c: remove dead assignmentAmit Shah1-1/+0
clang-analyzer points out a redundant assignment. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18VMware VGA: Only enable dirty log tracking when fifo is disabledAnthony Liguori1-0/+22
This patch enables dirty log tracking whenever it's needed and disables it when it is not. We unconditionally enable dirty log tracking on reset, restart dirty log tracking when PCI IO regions are remapped, and disable/enable it based on commands from the guest. Rebased-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18Make sure to enable dirty tracking of VBE vram mappingAnthony Liguori1-0/+24
Apparently, VBE maps the VGA vram to a fixed physical location. KVM requires that all mappings of the VGA vram have dirty tracking enabled on them. Any access to the VGA vram through the VBE mapping currently fails to result in dirty page tracking updates causing a black screen. This is the true root cause of VMware VGA not working correctly under KVM and likely also an issue with some of the std-vga black screen issues too. Cirrus does not enable VBE so it would not be a problem when using Cirrus. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Rebased-by: Dave Airlie <airlied@redhat.com>
2009-11-27Revert "vga: do not resize the screen on hw_invalidate"Aurelien Jarno1-3/+3
This causes ctrl+alt+u or ctrl+alt+f to not work when windows hasn't been resized first. Other graphic emulators do resize the screen on hw_invalidate. This reverts commit 0bd8246bfec1dfb2eb959f52db535572c0260f4c.
2009-11-07v3: don't call reset functions on cpu initializationGlauber Costa1-1/+0
There is absolutely no need to call reset functions when initializing devices. Since we are already registering them, calling qemu_system_reset() should suffice. Actually, it is what happens when we reboot the machine, and using the same process instead of a special case semantics will even allow us to find bugs easier. Furthermore, the fact that we initialize things like the cpu quite early, leads to the need to introduce synchronization stuff like qemu_system_cond. This patch removes it entirely. All we need to do is call qemu_system_reset() only when we're already sure the system is up and running I tested it with qemu (with and without io-thread) and qemu-kvm, and it seems to be doing okay - although qemu-kvm uses a slightly different patch. [ v2: user mode still needs cpu_reset, so put it in ifdef. ] [ v3: leave qemu_system_cond for now. ] Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-06vga: fix line comparisonmalc1-7/+5
Line counter doesn't wrap. Signed-off-by: malc <av1474@comtv.ru>
2009-11-06vga: Respect Line Compare Register in text modesmalc1-5/+13
Unbreaks setup screen of Act1/PL Signed-off-by: malc <av1474@comtv.ru>
2009-10-27vga: remove unused vga_common_save/loadJuan Quintela1-10/+0
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-27vga: port vga_common_save/load to vmstateJuan Quintela1-80/+51
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-27vga: create is_vbe_vmstate fieldJuan Quintela1-7/+10
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05vga: move back dirty_log functions to vga.cJuan Quintela1-0/+12
They are needed there on qemu-kvm. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01Revert "Get rid of _t suffix"Anthony Liguori1-9/+9
In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01Get rid of _t suffixmalc1-9/+9
Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>