diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-06-23 15:24:05 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-06-24 17:12:23 +0200 |
commit | 81ef3303f346cb888ffae14ca860bc5eccd76d81 (patch) | |
tree | bc71ee10eaf3fdea0f40f17a6ec869e4628f0da2 | |
parent | 5bf5f7424c0b3053a0af45c8840105a9ed65dfec (diff) |
qxl: drop compat property, add revision property
-rw-r--r-- | hw/qxl.c | 29 | ||||
-rw-r--r-- | hw/qxl.h | 4 |
2 files changed, 22 insertions, 11 deletions
@@ -1140,7 +1140,8 @@ static int qxl_init(PCIDevice *dev) VGACommonState *vga = &qxl->vga; uint8_t* config = qxl->pci.config; ram_addr_t ram_size = msb_mask(qxl->vga.vram_size * 2 - 1); - uint32_t pci_device_id = QXL_DEVICE_ID; + uint32_t pci_device_id; + uint32_t pci_device_rev; if (device_id == 0 && dev->qdev.hotplugged) { device_id++; @@ -1150,8 +1151,20 @@ static int qxl_init(PCIDevice *dev) qxl->mode = QXL_MODE_UNDEFINED; qxl->generation = 1; - if (qxl->compat) - pci_device_id = 0x100; /* qxl-1 */ + switch (qxl->revision) { + case 1: /* qxl-1 */ + pci_device_id = 0x0100; + pci_device_rev = 1; + break; + case 2: /* qxl-2 */ + pci_device_id = 0x0100; + pci_device_rev = 2; + break; + default: /* unstable */ + pci_device_id = 0x01ff; + pci_device_rev = 1; + break; + } if (!qxl->id) { if (ram_size < 32 * 1024 * 1024) @@ -1175,10 +1188,10 @@ static int qxl_init(PCIDevice *dev) register_displaychangelistener(vga->ds, &display_listener); if (qxl->pci.romfile == NULL) { - if (qxl->compat) { - qxl->pci.romfile = qemu_strdup("vgabios-qxl.bin"); - } else { + if (pci_device_id == 0x01ff) { qxl->pci.romfile = qemu_strdup("vgabios-qxldev.bin"); + } else { + qxl->pci.romfile = qemu_strdup("vgabios-qxl.bin"); } } pci_config_set_class(config, PCI_CLASS_DISPLAY_VGA); @@ -1193,7 +1206,7 @@ static int qxl_init(PCIDevice *dev) pci_config_set_vendor_id(config, REDHAT_PCI_VENDOR_ID); pci_config_set_device_id(config, pci_device_id); - pci_set_byte(&config[PCI_REVISION_ID], QXL_REVISION); + pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev); pci_set_byte(&config[PCI_INTERRUPT_PIN], 1); qxl->rom_size = qxl_rom_size(); @@ -1398,7 +1411,7 @@ static PCIDeviceInfo qxl_info = { .qdev.props = (Property[]) { DEFINE_PROP_UINT32("ram_size", PCIQXLDevice, vga.vram_size, 64 * 1024 * 1024), DEFINE_PROP_UINT32("vram_size", PCIQXLDevice, vram_size, 64 * 1024 * 1024), - DEFINE_PROP_UINT32("compat", PCIQXLDevice, compat, 0), + DEFINE_PROP_UINT32("revision", PCIQXLDevice, revision, 3), DEFINE_PROP_UINT32("debug", PCIQXLDevice, debug, 1), DEFINE_PROP_UINT32("cmdlog", PCIQXLDevice, cmdlog, 0), DEFINE_PROP_END_OF_LIST(), @@ -22,9 +22,7 @@ typedef struct PCIQXLDevice { enum qxl_mode mode; uint32_t cmdflags; int generation; - - /* temporary for development */ - uint32_t compat; + uint32_t revision; struct guest_slots { QXLMemSlot slot; |