summaryrefslogtreecommitdiffstats
path: root/hw/vga.c
Commit message (Collapse)AuthorAgeFilesLines
* vga: Implement blinking of text cursorJan Kiszka2012-07-141-2/+12
| | | | | | | | | Let the text cursor blink at 1.875 Hz, the original VGA cursor frequency. No timer is used, instead we rely on the fact that the display is updated periodically. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vga: make vram size configurableGerd Hoffmann2012-06-221-3/+10
| | | | | | | | | | | | | | | | | 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>
* vga: fix vram double-mapping with -vga std and -M pc-0.12Avi Kivity2012-05-291-1/+6
| | | | | | | | | | | | With pc-0.12, we map the video RAM both through the PCI BAR (the guest does this) and through a fixed mapping at 0xe0000000. The memory API doesn't allow this double map, and aborts. Fix by using an alias. Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: Don't switch to 1 x 1 character text screenStefan Weil2012-05-011-0/+4
| | | | | | | | | | | | | | | | | | | | Initially, vga_get_text_resolution returns a text resolution of 1 x 1 (vga register values are 0). This is visible during MIPS Malta boot with SDL. It also occurs with the i386 or x86_64 system emulation when it runs in single step mode: QEMU changes the size of the SDL window to the smallest possible value which is supported by the window manager. As this is not the calculated size, QEMU switches to scaled mode. When the BIOS or the VGA driver sets the normal text resolution, the window stays small and displays microscopic characters. Ignoring text resolutions of 1 x 1 or less avoids these problems. A similar workaround already exists for too large resolutions. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* fix screendumpGerd Hoffmann2012-03-241-1/+1
| | | | | | | | | | | | | | | | Commit 45efb16124efef51de5157afc31984b5a47700f9 optimized a bit too much. We can skip the vga_invalidate_display() in case no console switch happened because we don't need a full redraw then. We can *not* skip vga_hw_update() though, because the screen content will be stale then in case nobody else calls vga_hw_update(). Trigger: vga textmode with vnc display and no client connected. Reported-by: Avi Kivity <avi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com> Tested-by: Avi Kivity <avi@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vga: add trace event for ppm_saveAlon Levy2012-03-121-0/+2
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* optimize screendump for the common non-switch caseGerd Hoffmann2012-02-241-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>
* vga: simplify screendumpGerd Hoffmann2012-02-241-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>
* vga: Fix full updates in graphic modeJan Kiszka2012-02-111-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>
* Fix memory dirty getting API change falloutBlue Swirl2012-02-111-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>
* vga: improve documentationBlue Swirl2012-02-041-0/+12
| | | | | | Add links to chipset docs and FreeVGA site. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vga: use constants from vga.hBlue Swirl2012-02-041-168/+194
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* memory: change dirty getting API to take a sizeBlue Swirl2012-02-041-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>
* memory: change dirty setting APIs to take a sizeBlue Swirl2012-01-251-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>
* vga: optimize ppm_save() divisionsAvi Kivity2012-01-121-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>
* vmstate, memory: decouple vmstate from memory APIAvi Kivity2012-01-041-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>
* xen, vga: add API for registering the framebufferAvi Kivity2011-12-201-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>
* Move graphic-related coalesced MMIO flushes to affected device modelsJan Kiszka2011-10-151-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>
* vga: Convert to isa_register_portio_listRichard Henderson2011-10-111-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>
* vga: Respect isa_mem_base when registering chain4 aliasJan Kiszka2011-09-161-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>
* vga: Fix text mode screendumpsJan Kiszka2011-09-161-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>
* vga: Silence bogus gcc warning about uninitialized variablesJan Kiszka2011-08-251-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>
* vga: Use linear mapping + dirty logging in chain 4 memory access modeJan Kiszka2011-08-221-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>
* vmware-vga: Eliminate vga_dirty_log_restartJan Kiszka2011-08-221-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>
* vga: drop get_system_memory() from vga devices and derivativesAvi Kivity2011-08-221-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>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-4/+4
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: simplify vga window mmio access functionsAvi Kivity2011-08-081-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>
* vga: convert vga and its derivatives to the memory APIAvi Kivity2011-08-081-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>
* Optimize screendumpAvi Kivity2011-06-221-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>
* change all other clock references to use nanosecond resolution accessorsPaolo Bonzini2011-03-211-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>
* vga-isa: convert to qdevBlue Swirl2011-02-201-8/+14
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce log_start/log_stop in CPUPhysMemoryClientAnthony PERARD2011-02-141-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>
* Fix curses on big endian hostsAurelien Jarno2011-01-041-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>
* vga: Declare as little endianBlue Swirl2010-12-191-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>
* Add endianness as io mem parameterAlexander Graf2010-12-111-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>
* more stdvga cleanups.Gerd Hoffmann2010-11-161-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>
* VGA: Don't register deprecated VBE rangeAlex Williamson2010-08-221-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>
* qemu_ram_alloc: Add DeviceState and name parametersAlex Williamson2010-07-061-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>
* Fix %lld or %llx printf format useBlue Swirl2010-05-221-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vga: make some tables 'const'Blue Swirl2010-05-141-5/+5
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vga: fix typo in length passed to kvm_log_stopMarcelo Tosatti2010-04-281-2/+2
| | | | Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* x86: remove dead assignments, spotted by clang analyzerBlue Swirl2010-04-251-3/+6
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* update bochs vbe interfaceGerd Hoffmann2010-04-081-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>
* hw/vga.c: remove dead assignmentAmit Shah2010-01-131-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>
* VMware VGA: Only enable dirty log tracking when fifo is disabledAnthony Liguori2009-12-181-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>
* Make sure to enable dirty tracking of VBE vram mappingAnthony Liguori2009-12-181-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>
* Revert "vga: do not resize the screen on hw_invalidate"Aurelien Jarno2009-11-271-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.
* v3: don't call reset functions on cpu initializationGlauber Costa2009-11-071-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>
* vga: fix line comparisonmalc2009-11-061-7/+5
| | | | | | Line counter doesn't wrap. Signed-off-by: malc <av1474@comtv.ru>
* vga: Respect Line Compare Register in text modesmalc2009-11-061-5/+13
| | | | | | Unbreaks setup screen of Act1/PL Signed-off-by: malc <av1474@comtv.ru>
OpenPOWER on IntegriCloud