more stdvga cleanups.
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>
This commit is contained in:
parent
4eccfec494
commit
788954270d
@ -977,7 +977,7 @@ void mips_malta_init (ram_addr_t ram_size,
|
||||
} else if (vmsvga_enabled) {
|
||||
pci_vmsvga_init(pci_bus);
|
||||
} else if (std_vga_enabled) {
|
||||
pci_vga_init(pci_bus, 0, 0);
|
||||
pci_vga_init(pci_bus);
|
||||
}
|
||||
}
|
||||
|
||||
|
2
hw/pc.c
2
hw/pc.c
@ -993,7 +993,7 @@ void pc_vga_init(PCIBus *pci_bus)
|
||||
fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
|
||||
} else if (std_vga_enabled) {
|
||||
if (pci_bus) {
|
||||
pci_vga_init(pci_bus, 0, 0);
|
||||
pci_vga_init(pci_bus);
|
||||
} else {
|
||||
isa_vga_init();
|
||||
}
|
||||
|
3
hw/pc.h
3
hw/pc.h
@ -154,8 +154,7 @@ enum vga_retrace_method {
|
||||
extern enum vga_retrace_method vga_retrace_method;
|
||||
|
||||
int isa_vga_init(void);
|
||||
int pci_vga_init(PCIBus *bus,
|
||||
unsigned long vga_bios_offset, int vga_bios_size);
|
||||
int pci_vga_init(PCIBus *bus);
|
||||
int isa_vga_mm_init(target_phys_addr_t vram_base,
|
||||
target_phys_addr_t ctrl_base, int it_shift);
|
||||
|
||||
|
@ -316,7 +316,7 @@ static void ppc_core99_init (ram_addr_t ram_size,
|
||||
machine_arch = ARCH_MAC99;
|
||||
}
|
||||
/* init basic PC hardware */
|
||||
pci_vga_init(pci_bus, 0, 0);
|
||||
pci_vga_init(pci_bus);
|
||||
|
||||
escc_mem_index = escc_init(0x80013000, pic[0x25], pic[0x24],
|
||||
serial_hds[0], serial_hds[1], ESCC_CLOCK, 4);
|
||||
|
@ -227,7 +227,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
|
||||
}
|
||||
pic = heathrow_pic_init(&pic_mem_index, 1, heathrow_irqs);
|
||||
pci_bus = pci_grackle_init(0xfec00000, pic);
|
||||
pci_vga_init(pci_bus, 0, 0);
|
||||
pci_vga_init(pci_bus);
|
||||
|
||||
escc_mem_index = escc_init(0x80013000, pic[0x0f], pic[0x10], serial_hds[0],
|
||||
serial_hds[1], ESCC_CLOCK, 4);
|
||||
|
@ -694,7 +694,7 @@ static void ppc_prep_init (ram_addr_t ram_size,
|
||||
cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
|
||||
|
||||
/* init basic PC hardware */
|
||||
pci_vga_init(pci_bus, 0, 0);
|
||||
pci_vga_init(pci_bus);
|
||||
// openpic = openpic_init(0x00000000, 0xF0000000, 1);
|
||||
// pit = pit_init(0x40, i8259[0]);
|
||||
rtc_init(2000, NULL);
|
||||
|
@ -767,7 +767,7 @@ static void sun4uv_init(ram_addr_t RAM_size,
|
||||
pci_bus = pci_apb_init(APB_SPECIAL_BASE, APB_MEM_BASE, irq, &pci_bus2,
|
||||
&pci_bus3);
|
||||
isa_mem_base = APB_PCI_IO_BASE;
|
||||
pci_vga_init(pci_bus, 0, 0);
|
||||
pci_vga_init(pci_bus);
|
||||
|
||||
// XXX Should be pci_bus3
|
||||
pci_ebus_init(pci_bus, -1);
|
||||
|
42
hw/vga-pci.c
42
hw/vga-pci.c
@ -52,14 +52,11 @@ static void vga_map(PCIDevice *pci_dev, int region_num,
|
||||
{
|
||||
PCIVGAState *d = (PCIVGAState *)pci_dev;
|
||||
VGACommonState *s = &d->vga;
|
||||
if (region_num == PCI_ROM_SLOT) {
|
||||
cpu_register_physical_memory(addr, s->bios_size, s->bios_offset);
|
||||
} else {
|
||||
cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
|
||||
s->map_addr = addr;
|
||||
s->map_end = addr + s->vram_size;
|
||||
vga_dirty_log_start(s);
|
||||
}
|
||||
|
||||
cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
|
||||
s->map_addr = addr;
|
||||
s->map_end = addr + s->vram_size;
|
||||
vga_dirty_log_start(s);
|
||||
}
|
||||
|
||||
static void pci_vga_write_config(PCIDevice *d,
|
||||
@ -95,31 +92,12 @@ static int pci_vga_initfn(PCIDevice *dev)
|
||||
pci_register_bar(&d->dev, 0, VGA_RAM_SIZE,
|
||||
PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);
|
||||
|
||||
if (s->bios_size) {
|
||||
unsigned int bios_total_size;
|
||||
/* must be a power of two */
|
||||
bios_total_size = 1;
|
||||
while (bios_total_size < s->bios_size)
|
||||
bios_total_size <<= 1;
|
||||
pci_register_bar(&d->dev, PCI_ROM_SLOT, bios_total_size,
|
||||
PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);
|
||||
} else {
|
||||
if (dev->romfile == NULL)
|
||||
dev->romfile = qemu_strdup("vgabios-stdvga.bin");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pci_vga_init(PCIBus *bus,
|
||||
unsigned long vga_bios_offset, int vga_bios_size)
|
||||
int pci_vga_init(PCIBus *bus)
|
||||
{
|
||||
PCIDevice *dev;
|
||||
|
||||
dev = pci_create(bus, -1, "VGA");
|
||||
qdev_prop_set_uint32(&dev->qdev, "bios-offset", vga_bios_offset);
|
||||
qdev_prop_set_uint32(&dev->qdev, "bios-size", vga_bios_size);
|
||||
qdev_init_nofail(&dev->qdev);
|
||||
|
||||
pci_create_simple(bus, -1, "VGA");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -129,11 +107,7 @@ static PCIDeviceInfo vga_info = {
|
||||
.qdev.vmsd = &vmstate_vga_pci,
|
||||
.init = pci_vga_initfn,
|
||||
.config_write = pci_vga_write_config,
|
||||
.qdev.props = (Property[]) {
|
||||
DEFINE_PROP_HEX32("bios-offset", PCIVGAState, vga.bios_offset, 0),
|
||||
DEFINE_PROP_HEX32("bios-size", PCIVGAState, vga.bios_size, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
.romfile = "vgabios-stdvga.bin",
|
||||
};
|
||||
|
||||
static void vga_register(void)
|
||||
|
2
hw/vga.c
2
hw/vga.c
@ -1934,8 +1934,6 @@ void vga_common_reset(VGACommonState *s)
|
||||
s->map_addr = 0;
|
||||
s->map_end = 0;
|
||||
s->lfb_vram_mapped = 0;
|
||||
s->bios_offset = 0;
|
||||
s->bios_size = 0;
|
||||
s->sr_index = 0;
|
||||
memset(s->sr, '\0', sizeof(s->sr));
|
||||
s->gr_index = 0;
|
||||
|
@ -112,8 +112,6 @@ typedef struct VGACommonState {
|
||||
uint32_t map_addr;
|
||||
uint32_t map_end;
|
||||
uint32_t lfb_vram_mapped; /* whether 0xa0000 is mapped as ram */
|
||||
uint32_t bios_offset;
|
||||
uint32_t bios_size;
|
||||
uint32_t latch;
|
||||
uint8_t sr_index;
|
||||
uint8_t sr[256];
|
||||
|
Loading…
Reference in New Issue
Block a user