summaryrefslogtreecommitdiff
path: root/hw/cirrus_vga.c
AgeCommit message (Collapse)AuthorFilesLines
2011-01-10Merge remote branch 'origin/master' into pciMichael S. Tsirkin1-135/+48
2011-01-10vga: tag as not hotplugable.Gerd Hoffmann1-0/+1
This patch tags all vga cards as not hotpluggable. The qemu standard vga will never ever be hotpluggable. For cirrus + vmware it might be possible to get that work some day. Todays we can't handle that for a number of reasons though. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-06cirrus: delete GCC 4.6 warningsAurelien Jarno1-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>
2011-01-06cirrus_vga: Declare as little endianBlue Swirl1-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>
2011-01-04cirrus_vga: fix division by 0 for color expansion ropAurelien Jarno1-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>
2010-12-11Add endianness as io mem parameterAlexander Graf1-4/+8
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-22pci: Replace unneeded type casts in calls of pci_register_barStefan Weil1-2/+2
There is no need for these type casts (as other existing code shows). So re-write the first argument without type cast (and remove a related TODO comment). 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>
2010-10-13cirrus: avoid write only variablesBlue Swirl1-15/+15
Compiling with GCC 4.6.0 20100925 produced a lot of warnings like: In file included from /src/qemu/hw/cirrus_vga_rop.h:174:0, from /src/qemu/hw/cirrus_vga.c:284: /src/qemu/hw/cirrus_vga_rop2.h: In function 'cirrus_patternfill_0_8': /src/qemu/hw/cirrus_vga_rop2.h:48:18: error: variable 'col' set but not used [-Werror=unused-but-set-variable] /src/qemu/hw/cirrus_vga_rop2.h: In function 'cirrus_colorexpand_transp_0_8': /src/qemu/hw/cirrus_vga_rop2.h:104:18: error: variable 'col' set but not used [-Werror=unused-but-set-variable] Fix the warnings by introducing an inline function, which avoids exposing write-only variables. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-06savevm: Add DeviceState paramAlex Williamson1-1/+1
When available, we'd like to be able to access the DeviceState when registering a savevm. For buses with a get_dev_path() function, this will allow us to create more unique savevm id strings. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-22vmstate: fix breakage by 7e72abc382b700a72549e8147bdea413534eeedcTeLeMan1-1/+0
cirrus_post_load() will be executed twice when loading vm states and then the wrong physical memory will be registered. This issue may lead to crash qemu. Signed-off-by: TeLeMan <geleman@gmail.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-29cirrus: Properly re-register cirrus_linear_io_addr on vram unmapJan Kiszka1-2/+4
This fixes CONFIG_FB_CIRRUS for Linux guests and probably much more: When switching away from linearly mapped vram, we also have to restore the I/O handlers for the LFB. This regression was once introduced by commit 2bec46dc97. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18pci romfiles: add property, add default to PCIDeviceInfoGerd Hoffmann1-3/+1
This patch adds a romfile property to the pci bus. It allows to specify a romfile to load into the rom bar of the pci device. The default value comes from a new field in PCIDeviceInfo. The property allows to change the file and also to disable the rom loading using an empty string. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18Support PCI based option rom loadingAnthony Liguori1-1/+1
Currently, we preload option roms into the option rom space in memory. This prevents DDIM from functioning correctly which severely limits the number of roms we can support. This patch introduces a pci_add_option_rom() which registers the PCI_ROM_ADDRESS bar which points to our option rom. It also converts over the cirrus vga adapter, the rtl8139, virtio, and the e1000 to use this new mechanism. The result is that PXE boot functions even with three unique types of cards. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12qdev: Replace device names containing whitespaceMarkus Armbruster1-2/+3
Device names with whitespace require quoting in the shell and in the monitor. Some of the offenders are also overly long. Some have a more convenient alias, some don't. The place for verbose device names is DeviceInfo member desc. The name should be short & sweet. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03qemu: cleanup unused macros in cirrusMichael S. Tsirkin1-35/+0
Cirrus vga has a copy of many PCI macros, and it doesn't even use them. Clean up. We also don't need to override header type as it is NORMAL by default. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03qemu: make cirrus init value pci spec compliantMichael S. Tsirkin1-1/+0
PCI memory should be disabled at reset, otherwise we might claim transactions at address 0. I/O should also be disabled, although for cirrus it is harmless to enable it as we do not have I/O bar. Note: bios fix needed for this patch to work was already applied: previously bios incorrently assumed that it does not need to enable i/o unless device has i/o bar. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03savevm: Port to qdev.vmsd all devices that have qdevJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci: initialize pci config headers depending it pci header type.Isaku Yamahata1-1/+0
- Only sets default subsystem id for header type 00.(normal header type) because header type 01 doesn't have subsystem id, and uses the register for other purpose. So setting default subsystem id doesn't make sense. - initialize wmask more for header type 01.(bridge header type) Without those wmasks, linux was confused not boot, and lspci was confused not to print out expected IO/memory range. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci: introduce pcibus_t to represent pci bus address/size instead of uint32_tIsaku Yamahata1-2/+2
This patch is preliminary for 64 bit BAR support. Introduce dedicated type, pcibus_t, to represent pci bus address/size instead of uint32_t. Later this type will be changed to uint64_t. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.hIsaku Yamahata1-2/+2
make constants for pci base address match pci_regs.h by renaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci: define a constant to represent a unmapped bar and use it.Isaku Yamahata1-1/+1
define a constant to represent a unmapped bar instead of -1 and use it. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30vga roms: move loading from pc.c to vga drivers.Gerd Hoffmann1-1/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05vmstate: add version_id argument to post_loadJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05cirrus_vga: also assign gr0/1 when writting shadow_gr0/1Juan Quintela1-0/+2
This is a regression/bug caused by previous vga_cleanup. This fixes Ubuntu installer reported by: Pierre Riteau 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-25/+25
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-25/+25
Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
2009-09-11vmstate: port cirrus_vga deviceJuan Quintela1-98/+54
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: CIRRUS_HOOK_* is not used anymoreJuan Quintela1-5/+0
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: rename cirrus_hook_write_cr() cirrus_vga_write_cr()Juan Quintela1-32/+27
Simplify the logic to do everything inside the function. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: rename cirrus_hook_read_cr() cirrus_vga_read_cr()Juan Quintela1-15/+7
Simplify the logic to do everything inside the function. Return 0xff if index is out of range independetly of DEBUG_CIRRUS Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: rename cirrus_hook_write_gr() cirrus_vga_write_gr()Juan Quintela1-41/+38
Simplify the logic to do everything inside the function. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: rename cirrus_hook_read_gr() cirrus_vga_read_gr()Juan Quintela1-45/+38
Simplify the logic to do everything inside the function. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: rename cirrus_hook_write_palette() cirrus_vga_write_palette()Juan Quintela1-15/+9
Simplify the logic to do everything inside the function Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: rename cirrus_hook_read_palette() cirrus_vga_read_palette()Juan Quintela1-15/+12
Simplify the logic to do everything inside the function Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: rename cirrus_hook_write_sr() cirrus_vga_write_sr()Juan Quintela1-23/+22
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: rename cirrus_hook_read_sr() cirrus_vga_read_sr()Juan Quintela1-20/+12
And make it a real function Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09vga and cirrus_vga: substitute switch for equivalent assigntmentJuan Quintela1-14/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: make cirrus_read_hidden_dac() return its resultJuan Quintela1-5/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: Add a VGACommonState local var to cirrus_vga_ioport_{read, write}Juan Quintela1-80/+82
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09vga and cirrus_vga: create vga_ioport_invalid() and use it everywhereJuan Quintela1-8/+3
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09cirrus_vga: prefix vga_ioport_{read, write} with cirrusJuan Quintela1-14/+14
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Add pci_cirrus_vga_{save/load} functions, then remove vga.pci_dev useJuan Quintela1-12/+27
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27cirrus_vga: Change casts to DO_UPCAST() for PCICirrusVGAStateJuan Quintela1-5/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27cirrus_vga: remove pointless cast from void *Juan Quintela1-5/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Everything outside of vga.c should use VGACommonStateJuan Quintela1-5/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Introduce vga_common_reset() to be able to typcheck vga_reset()Juan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27qdev: add return value to init() callbacks.Gerd Hoffmann1-1/+2
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>
2009-08-25Make CPURead/WriteFunc structure 'const'Blue Swirl1-8/+8
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-30qdev: convert all vga devices.Gerd Hoffmann1-38/+47
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-20Fix most warnings (errors with -Werror) when debugging is enabledBlue Swirl1-2/+3
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>