Received: from eggs.gnu.org ([140.186.70.92]:38666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJY6z-00044N-Df for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJY6x-0006PE-H5 for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:29 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:38418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJY6x-0006Af-9W for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:27 -0400 Received: by mail-iw0-f173.google.com with SMTP id 42so5560360iwl.4 for ; Mon, 09 May 2011 14:35:27 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 9 May 2011 14:34:47 -0700 Message-Id: <1304976889-29675-34-git-send-email-rth@twiddle.net> In-Reply-To: <1304976889-29675-1-git-send-email-rth@twiddle.net> References: <1304976889-29675-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 33/35] target-alpha: Properly select the VGA controler to use. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The existing code for this really shouldn't be in pc.c. Signed-off-by: Richard Henderson --- hw/alpha_dp264.c | 2 +- hw/alpha_pci.c | 33 ++++++++++++++++++++++++++++++++- hw/alpha_sys.h | 2 ++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/hw/alpha_dp264.c b/hw/alpha_dp264.c index c061b0a..dea0ef6 100644 --- a/hw/alpha_dp264.c +++ b/hw/alpha_dp264.c @@ -83,7 +83,7 @@ static void clipper_init(ram_addr_t ram_size, pit_init(0x40, 0); /* VGA setup. Don't bother loading the bios. */ - pci_vga_init(pci_bus); + alpha_pci_vga_setup(pci_bus); /* Serial code setup. */ for (i = 0; i < MAX_SERIAL_PORTS; ++i) { diff --git a/hw/alpha_pci.c b/hw/alpha_pci.c index d0d727c..b321772 100644 --- a/hw/alpha_pci.c +++ b/hw/alpha_pci.c @@ -1,8 +1,15 @@ -/* There's nothing in here that's Alpha specific, really. */ +/* + * QEMU Alpha PCI support functions. + * + * Some of this isn't very Alpha specific at all. Some of this is specific + * to sparse PCI access support for older Alpha systems. + */ #include "config.h" #include "alpha_sys.h" #include "qemu-log.h" +#include "sysemu.h" +#include "vmware_vga.h" /* PCI IO reads, to byte-word addressable memory. */ @@ -325,3 +332,27 @@ CPUWriteMemoryFunc * const alpha_pci_special_writes[] = { unassigned_mem_writew, special_writel, }; + +void alpha_pci_vga_setup(PCIBus *pci_bus) +{ + switch (vga_interface_type) { +#ifdef CONFIG_SPICE + case VGA_QXL: + pci_create_simple(pci_bus, -1, "qxl-vga"); + return; +#endif + case VGA_CIRRUS: + pci_cirrus_vga_init(pci_bus); + return; + case VGA_VMWARE: + if (pci_vmsvga_init(pci_bus)) { + return; + } + break; + } + /* If VGA is enabled at all, and one of the above didn't work, then + fallback to Standard VGA. */ + if (vga_interface_type != VGA_NONE) { + pci_vga_init(pci_bus); + } +} diff --git a/hw/alpha_sys.h b/hw/alpha_sys.h index 272a107..98e5351 100644 --- a/hw/alpha_sys.h +++ b/hw/alpha_sys.h @@ -39,4 +39,6 @@ extern void alpha_sparse_mem_write(PCIBus *, target_phys_addr_t, uint32_t); extern uint32_t alpha_sparse_conf1_read(PCIBus *, target_phys_addr_t); extern void alpha_sparse_conf1_write(PCIBus *, target_phys_addr_t, uint32_t); +void alpha_pci_vga_setup(PCIBus *pci_bus); + #endif -- 1.7.4.4