summaryrefslogtreecommitdiffstats
path: root/hw/cirrus_vga.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* ui: move files to ui/ and include/ui/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* pci: update all users to look in pci/Michael S. Tsirkin2012-12-171-1/+1
| | | | | | update all users so we can remove the makefile hack. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/cirrus_vga.c: Replace register_ioport_*Julien Grall2012-12-041-20/+28
| | | | | | | | | | Replace all register_ioport_*() with the new Memory API. This permits to use the new Memory stuff like listeners. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto hwaddr] Signed-off-by: Andreas Färber <afaerber@suse.de>
* cirrus_vga: allow configurable vram sizeMarcelo Tosatti2012-10-301-5/+16
| | | | | | | | Allow RAM size to be configurable for cirrus, to allow migration compatibility from qemu-kvm. Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Rename target_phys_addr_t to hwaddrAvi Kivity2012-10-231-8/+8
| | | | | | | | | | | | | | | 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>
* vga: cleanup after isa_vga_init() and pci_vga_init() conversionAurelien Jarno2012-10-061-6/+0
| | | | | | | | Now that all machines call isa_vga_init() or pci_vga_init(), some unused code can be removed. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* VGA: Flush coalesced MMIO on related MMIO/PIO accessesJan Kiszka2012-09-111-0/+7
| | | | | | | | | | 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>
* Revert "fix some debug printf format strings"malc2012-08-271-2/+2
| | | | | | This reverts commit 145c7c880ff520a9348cc2401ba291330b9606fe. Signed-off-by: malc <av1474@comtv.ru>
* fix some debug printf format stringsMatthew Ogilvie2012-08-241-2/+2
| | | | | | | | These are normally ifdefed out and don't matter. But if you enable them, they ought to be correct. Signed-off-by: Matthew Ogilvie <mmogilvi_qemu@miniinfo.net> Signed-off-by: malc <av1474@comtv.ru>
* Add one new file vga-pci.h and cleanup on all platformszhlcindy@gmail.com2012-08-151-1/+1
| | | | | | | | | | | | Functions pci_vga_init() and pci_cirrus_vga_init() are declared in pc.h. That prevents other platforms (e.g. sPAPR) to use them. This patch is to create one new file vga-pci.h and move the declarations to vga-pci.h, so that they can be shared by all platforms. This patch also cleans up on all platforms. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* vga: make vram size configurableGerd Hoffmann2012-06-221-2/+6
| | | | | | | | | | | | | | | | | 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>
* cirrus_vga: do not reset videoramStefano Stabellini2012-03-131-4/+0
| | | | | | | | There is no need to set the videoram to 0xff in cirrus_reset, because it is the BIOS' job. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Avi Kivity <avi@redhat.com>
* qom: Unify type registrationAndreas Färber2012-02-151-8/+4
| | | | | | | | | | | | | 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>
* vga: move Cirrus VGA template to its own fileBlue Swirl2012-02-041-0/+9
| | | | | | | Standard VGA does not use vga_draw_cursor_line_* functions. Move the template to cirrus_vga_template.h. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev: register all types natively through QEMU Object ModelAnthony Liguori2012-02-031-13/+17
| | | | | | | | | | | | | | | | | | | | | 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>
* pci: convert to QEMU Object ModelAnthony Liguori2012-01-271-13/+20
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* isa: pic: convert to QEMU Object ModelAnthony Liguori2012-01-271-5/+12
| | | | | | | This converts two devices at once because PIC subclasses ISA and converting subclasses independently is extremely hard. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: move qdev->info to classAnthony Liguori2012-01-271-1/+1
| | | | | | | | Right now, DeviceInfo acts as the class for qdev. In order to switch to a proper ObjectClass derivative, we need to ween all of the callers off of interacting directly with the info pointer. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: compile cirrus_vga in hwlibBlue Swirl2012-01-251-3/+0
| | | | | | | | Remove target dependencies and compile Cirrus VGA in hwlib. Address masking can be removed since memory API handles that now. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* memory: change dirty setting APIs to take a sizeBlue Swirl2012-01-251-10/+6
| | | | | | | 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: make Cirrus ISA device optionalBlue Swirl2012-01-221-12/+29
| | | | | Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote-tracking branch 'qemu-kvm/memory/mutators' into stagingAnthony Liguori2011-12-191-33/+17
|\ | | | | | | | | Conflicts: memory.h
| * cirrus_vga: adapt to memory mutators APIAvi Kivity2011-12-051-33/+17
| | | | | | | | | | | | | | Simplify the code by avoiding dynamic creation and destruction of memory regions. Signed-off-by: Avi Kivity <avi@redhat.com>
* | qom: add vga node to the pc composition treeAnthony Liguori2011-12-151-3/+5
| | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | fix spelling in hw sub directoryDong Xu Wang2011-12-061-1/+1
|/ | | | | | | Correct obvious spelling errors in qemu/hw directory. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* cirrus: Unbreak ISA supportJan Kiszka2011-09-231-2/+2
| | | | | | | Do not try to map against the PCI bar in the ISA version of the device. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* cirrus: wrap memory update in a transactionAvi Kivity2011-09-041-0/+2
| | | | | | | | This prevents spurious unmapping and remapping of the vga windows, which reduces performance. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
* Revert "Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging"Anthony Liguori2011-08-251-2/+0
| | | | | | | | | | | | This reverts commit 8ef9ea85a2cc1007eaefa53e6871f1f83bcef22d, reversing changes made to 444dc48298c480e42e15a8fe676be737d8a6b2a1. From Avi: Please revert the entire pull (git revert 8ef9ea85a2cc1) while I work this out - it isn't trivial. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* cirrus: wrap memory update in a transactionAvi Kivity2011-08-251-0/+2
| | | | | | | | This prevents spurious unmapping and remapping of the vga windows, which reduces performance. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
* vga: drop get_system_memory() from vga devices and derivativesAvi Kivity2011-08-221-6/+6
| | | | | | | | 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-5/+3
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: rename pci_register_bar_region() to pci_register_bar()Avi Kivity2011-08-081-3/+2
| | | | | | | 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>
* cirrus: simplify linear framebuffer access functionsAvi Kivity2011-08-081-66/+8
| | | | | | | | | | Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. 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: simplify vga window mmio access functionsAvi Kivity2011-08-081-2/+2
| | | | | | | | | | | | 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>
* cirrus: simplify vga window mmio access functionsAvi Kivity2011-08-081-68/+11
| | | | | | | | | | Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. 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>
* cirrus: simplify bitblt BAR access functionsAvi Kivity2011-08-081-68/+13
| | | | | | | | | | Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. 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>
* cirrus: simplify mmio BAR access functionsAvi Kivity2011-08-081-70/+8
| | | | | | | | | Make use of the memory API's ability to satisfy multi-byte accesses via multiple single-byte accesses. Reviewed-by: Richard Henderson <rth@twiddle.net> 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-140/+202
| | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'mst/for_anthony' into stagingAnthony Liguori2011-06-221-5/+5
|\ | | | | | | | | Conflicts: hw/usb-uhci.c
| * hw/cirrus_vga.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-5/+5
| | | | | | | | | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | cirrus_vga: reset lfb_addr after a pci config write if the BAR is unmappedStefano Stabellini2011-06-191-1/+4
|/ | | | | | | | | | If the cirrus_vga PCI BAR is unmapped than we should not only reset map_addr but also lfb_addr, otherwise we'll keep trying to map the old lfb_addr in map_linear_vram. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* cirrus-vga: convert to pci_register_bar_simple()Avi Kivity2011-04-071-11/+2
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* cirrus_vga: flag on-device ram for dirty loggingMichael S. Tsirkin2011-04-071-5/+11
| | | | Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* cirrus_vga: remove unneeded resetStefan Weil2011-03-281-1/+0
| | | | | | | | | cirrus_reset is already called by the reset framework, so there is no need to call it in cirrus_init_common. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* cirrus: Remove obsolete kvm.h includeJan Kiszka2011-02-141-1/+0
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Merge remote branch 'origin/master' into pciMichael S. Tsirkin2011-01-101-135/+48
|\
| * cirrus: delete GCC 4.6 warningsAurelien Jarno2011-01-061-3/+3
| | | | | | | | | | | | | | | | Commit 92d675d1c1f23f3617e24b63c825074a1d1da44b triggered uninitialized variables warning with GCC 4.6. Fix them by adding zero initializers. Acked-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * cirrus_vga: Declare as little endianBlue Swirl2011-01-061-100/+12
| | | | | | | | | | | | | | | | This patch replaces explicit bswaps with endianness hints to the mmio layer. CC: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
| * cirrus_vga: fix division by 0 for color expansion ropAurelien Jarno2011-01-041-32/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regression with Windows ME that leads to a division by 0 and a crash. It uses the color expansion rop with the source pitch set to 0. This is something allowed, as the manual explicitely says "When the source of color-expand data is display memory, the source pitch is ignored.". This patch fixes this regression by computing sx, sy and others variables only if they are going to be used later, that is for a plain copy ROP. It basically consists in moving code. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
OpenPOWER on IntegriCloud