~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to hw/display/vmware_vga.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
    int redraw_fifo_first, redraw_fifo_last;
82
82
};
83
83
 
 
84
#define TYPE_VMWARE_SVGA "vmware-svga"
 
85
 
 
86
#define VMWARE_SVGA(obj) \
 
87
    OBJECT_CHECK(struct pci_vmsvga_state_s, (obj), TYPE_VMWARE_SVGA)
 
88
 
84
89
struct pci_vmsvga_state_s {
85
 
    PCIDevice card;
 
90
    /*< private >*/
 
91
    PCIDevice parent_obj;
 
92
    /*< public >*/
 
93
 
86
94
    struct vmsvga_state_s chip;
87
95
    MemoryRegion io_bar;
88
96
};
787
795
    case SVGA_REG_FB_START: {
788
796
        struct pci_vmsvga_state_s *pci_vmsvga
789
797
            = container_of(s, struct pci_vmsvga_state_s, chip);
790
 
        ret = pci_get_bar_addr(&pci_vmsvga->card, 1);
 
798
        ret = pci_get_bar_addr(PCI_DEVICE(pci_vmsvga), 1);
791
799
        break;
792
800
    }
793
801
 
823
831
    case SVGA_REG_MEM_START: {
824
832
        struct pci_vmsvga_state_s *pci_vmsvga
825
833
            = container_of(s, struct pci_vmsvga_state_s, chip);
826
 
        ret = pci_get_bar_addr(&pci_vmsvga->card, 2);
 
834
        ret = pci_get_bar_addr(PCI_DEVICE(pci_vmsvga), 2);
827
835
        break;
828
836
    }
829
837
 
1092
1100
 
1093
1101
static void vmsvga_reset(DeviceState *dev)
1094
1102
{
1095
 
    struct pci_vmsvga_state_s *pci =
1096
 
        DO_UPCAST(struct pci_vmsvga_state_s, card.qdev, dev);
 
1103
    struct pci_vmsvga_state_s *pci = VMWARE_SVGA(dev);
1097
1104
    struct vmsvga_state_s *s = &pci->chip;
1098
1105
 
1099
1106
    s->index = 0;
1172
1179
    .minimum_version_id = 0,
1173
1180
    .minimum_version_id_old = 0,
1174
1181
    .fields      = (VMStateField[]) {
1175
 
        VMSTATE_PCI_DEVICE(card, struct pci_vmsvga_state_s),
 
1182
        VMSTATE_PCI_DEVICE(parent_obj, struct pci_vmsvga_state_s),
1176
1183
        VMSTATE_STRUCT(chip, struct pci_vmsvga_state_s, 0,
1177
1184
                       vmstate_vmware_vga_internal, struct vmsvga_state_s),
1178
1185
        VMSTATE_END_OF_LIST()
1194
1201
    s->vga.con = graphic_console_init(dev, &vmsvga_ops, s);
1195
1202
 
1196
1203
    s->fifo_size = SVGA_FIFO_SIZE;
1197
 
    memory_region_init_ram(&s->fifo_ram, "vmsvga.fifo", s->fifo_size);
 
1204
    memory_region_init_ram(&s->fifo_ram, NULL, "vmsvga.fifo", s->fifo_size);
1198
1205
    vmstate_register_ram_global(&s->fifo_ram);
1199
1206
    s->fifo_ptr = memory_region_get_ram_ptr(&s->fifo_ram);
1200
1207
 
1201
 
    vga_common_init(&s->vga);
1202
 
    vga_init(&s->vga, address_space, io, true);
 
1208
    vga_common_init(&s->vga, OBJECT(dev));
 
1209
    vga_init(&s->vga, OBJECT(dev), address_space, io, true);
1203
1210
    vmstate_register(NULL, 0, &vmstate_vga_common, &s->vga);
1204
1211
    s->new_depth = 32;
1205
1212
}
1241
1248
    .valid = {
1242
1249
        .min_access_size = 4,
1243
1250
        .max_access_size = 4,
 
1251
        .unaligned = true,
 
1252
    },
 
1253
    .impl = {
 
1254
        .unaligned = true,
1244
1255
    },
1245
1256
};
1246
1257
 
1247
1258
static int pci_vmsvga_initfn(PCIDevice *dev)
1248
1259
{
1249
 
    struct pci_vmsvga_state_s *s =
1250
 
        DO_UPCAST(struct pci_vmsvga_state_s, card, dev);
1251
 
 
1252
 
    s->card.config[PCI_CACHE_LINE_SIZE] = 0x08;         /* Cache line size */
1253
 
    s->card.config[PCI_LATENCY_TIMER] = 0x40;           /* Latency timer */
1254
 
    s->card.config[PCI_INTERRUPT_LINE] = 0xff;          /* End */
1255
 
 
1256
 
    memory_region_init_io(&s->io_bar, &vmsvga_io_ops, &s->chip,
 
1260
    struct pci_vmsvga_state_s *s = VMWARE_SVGA(dev);
 
1261
 
 
1262
    dev->config[PCI_CACHE_LINE_SIZE] = 0x08;
 
1263
    dev->config[PCI_LATENCY_TIMER] = 0x40;
 
1264
    dev->config[PCI_INTERRUPT_LINE] = 0xff;          /* End */
 
1265
 
 
1266
    memory_region_init_io(&s->io_bar, NULL, &vmsvga_io_ops, &s->chip,
1257
1267
                          "vmsvga-io", 0x10);
1258
1268
    memory_region_set_flush_coalesced(&s->io_bar);
1259
 
    pci_register_bar(&s->card, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_bar);
 
1269
    pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_bar);
1260
1270
 
1261
1271
    vmsvga_init(DEVICE(dev), &s->chip,
1262
1272
                pci_address_space(dev), pci_address_space_io(dev));
1263
1273
 
1264
 
    pci_register_bar(&s->card, 1, PCI_BASE_ADDRESS_MEM_PREFETCH,
 
1274
    pci_register_bar(dev, 1, PCI_BASE_ADDRESS_MEM_PREFETCH,
1265
1275
                     &s->chip.vga.vram);
1266
 
    pci_register_bar(&s->card, 2, PCI_BASE_ADDRESS_MEM_PREFETCH,
 
1276
    pci_register_bar(dev, 2, PCI_BASE_ADDRESS_MEM_PREFETCH,
1267
1277
                     &s->chip.fifo_ram);
1268
1278
 
1269
1279
    if (!dev->rom_bar) {
1270
1280
        /* compatibility with pc-0.13 and older */
1271
 
        vga_init_vbe(&s->chip.vga, pci_address_space(dev));
 
1281
        vga_init_vbe(&s->chip.vga, OBJECT(dev), pci_address_space(dev));
1272
1282
    }
1273
1283
 
1274
1284
    return 0;
1296
1306
    dc->reset = vmsvga_reset;
1297
1307
    dc->vmsd = &vmstate_vmware_vga;
1298
1308
    dc->props = vga_vmware_properties;
 
1309
    set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
1299
1310
}
1300
1311
 
1301
1312
static const TypeInfo vmsvga_info = {
1302
 
    .name          = "vmware-svga",
 
1313
    .name          = TYPE_VMWARE_SVGA,
1303
1314
    .parent        = TYPE_PCI_DEVICE,
1304
1315
    .instance_size = sizeof(struct pci_vmsvga_state_s),
1305
1316
    .class_init    = vmsvga_class_init,