summaryrefslogtreecommitdiffstats
path: root/hw/vga.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* vga: remove unused vga_common_save/loadJuan Quintela2009-10-271-10/+0
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: port vga_common_save/load to vmstateJuan Quintela2009-10-271-80/+51
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: create is_vbe_vmstate fieldJuan Quintela2009-10-271-7/+10
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: move back dirty_log functions to vga.cJuan Quintela2009-10-051-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>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-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>
* Get rid of _t suffixmalc2009-10-011-9/+9
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* Unexport ticks_per_sec variable. Create get_ticks_per_sec() functionJuan Quintela2009-09-111-3/+3
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: Rename last VGAState occurrences to VGACommonStateJuan Quintela2009-09-091-31/+29
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga and cirrus_vga: substitute switch for equivalent assigntmentJuan Quintela2009-09-091-13/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: change tabs to spacesJuan Quintela2009-09-091-3/+3
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga and cirrus_vga: create vga_ioport_invalid() and use it everywhereJuan Quintela2009-09-091-6/+14
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: split vga-isa-mm.oJuan Quintela2009-09-091-96/+0
| | | | | | | | | It is only used in mips softmmu, compile only there. it_shift field was only used for vga_isa_mm, move it from VGACommonState to ISAVGAMMstate. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: export vga_mem_{read,write}Juan Quintela2009-09-091-2/+2
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: split isa bits inco vga-isa.cJuan Quintela2009-09-091-21/+0
| | | | | | | | Adjust all the VGAState in VGACommonState Compile vga-isa.o in the targets that use it Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: split pci bits into vga-pci.cJuan Quintela2009-09-091-134/+0
| | | | | | | | Adjust all the VGAState in VGACommonState Compile vga-pci.o only for targets that use it. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: split vga_{load, save} into pci and common partsJuan Quintela2009-09-091-18/+34
| | | | | | | | | Once there adjust VGAState <-> VGACommonState Export vga_common_save/vga_common_load (nreeded by wmvare_vga Remove vga.pci_dev field, it is not needed anymore Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: export vga_ioport_{read,write}Juan Quintela2009-09-091-4/+4
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: remove useless cast from void *Juan Quintela2009-09-091-5/+5
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Everything outside of vga.c should use VGACommonStateJuan Quintela2009-08-271-1/+3
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: Rename vga_state -> vgaJuan Quintela2009-08-271-6/+6
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce vga_common_reset() to be able to typcheck vga_reset()Juan Quintela2009-08-271-3/+7
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: add return value to init() callbacks.Gerd Hoffmann2009-08-271-2/+3
| | | | | | | | | | | | | | | | | | Sorry folks, but it has to be. One more of these invasive qdev patches. We have a serious design bug in the qdev interface: device init callbacks can't signal failure because the init() callback has no return value. This patch fixes it. We have already one case in-tree where this is needed: Try -device virtio-blk-pci (without drive= specified) and watch qemu segfault. This patch fixes it. With usb+scsi being converted to qdev we'll get more devices where the init callback can fail for various reasons. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make CPURead/WriteFunc structure 'const'Blue Swirl2009-08-251-4/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* make vga screen_dump use DisplayState properlyStefano Stabellini2009-08-241-69/+21
| | | | | | | | | | | | | | Hi all, currently the vga screen_dump code doesn't use the DisplayState interface properly and tries to replace it temporarily while taking the screenshot. A better approach is to register a DisplayChangeListener, call vga_hw_update, and finally write the ppm in the next call from dpy_update. Testing is appreciated. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev/prop: convert vga.c to helper macros.Gerd Hoffmann2009-08-101-10/+3
| | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
* vga: do not resize the screen on hw_invalidateStefano Stabellini2009-08-101-3/+3
| | | | | | | | | | | | Hi all, currently vga always resizes the screen when vga_hw_invalidate is called while this is not required and all the other graphic emulators don't. This patch fixes it, making vga invalidate behaviour consistent with the other emulated devices. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
* qdev: convert all vga devices.Gerd Hoffmann2009-07-301-37/+63
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIANJuan Quintela2009-07-271-7/+7
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix most warnings (errors with -Werror) when debugging is enabledBlue Swirl2009-07-201-6/+6
| | | | | | | I used the following command to enable debugging: perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * */* */*/* Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Introduce reset notifier order"Jan Kiszka2009-06-291-1/+1
| | | | | | | | | This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and updates later added users of qemu_register_reset), we solved the problem it originally addressed less invasively. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix vga_screen_dump_blank() PPM generationEduardo Habkost2009-06-161-2/+3
| | | | | | | | | vga_screen_dump_blank() was not generating a valid PPM file: the width of the image made no sense (why it was multiplied by sizeof(uint32_t)?), and there was only one sample per pixel, instead of three. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rename pci_register_io_region() to pci_register_bar()Avi Kivity2009-06-161-2/+2
| | | | | | | | This function is used to manage a PCI BAR, so make the more generic pci_register_io_region() available to other uses. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud