From patchwork Mon May 9 21:34:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 94878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5FA81B6F11 for ; Tue, 10 May 2011 07:43:22 +1000 (EST) Received: from localhost ([::1]:41514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJYEZ-0000T5-O7 for incoming@patchwork.ozlabs.org; Mon, 09 May 2011 17:43:19 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=iwUzfaG2i4SoQnEde7se3qLTn1rw3xSuV1PHp2zQhl8=; b=leAiuCJd+bs/lCcQRJXqv6ImD9l3ei36gbXNpjC7x6/mv+lRk8w2mZTq7ZHGhxBIh9 UHN16faX4xHAkoiRi8ez5jsaETd4vWGawSRtjGUr9eppTx/wc8tc+pF29JuXuOG0QEQU B5HDVly22vuWAqVgG/DYgXr8dpVXWuwPqNqlU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=s4+/2GfRdTowFbmz22Q47RrplDo2HqUl994I9OsUOQBG40/SB8jSHHNIY/bjBA7CuX uuBKscc9C4yRvgsQvG3eqB7gdfxpMErsp/QwGLjqWoSuphTQFZBI/2pKKmlJBd0koOwb P/izaHTsABy7b5fyZQCIzjIiFNxfu/USp7tko= Received: by 10.42.146.196 with SMTP id k4mr7046717icv.105.1304976927050; Mon, 09 May 2011 14:35:27 -0700 (PDT) Received: from localhost.localdomain (are.twiddle.net [75.101.38.216]) by mx.google.com with ESMTPS id ui7sm2549819icb.14.2011.05.09.14.35.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2011 14:35:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 9 May 2011 14:34:47 -0700 Message-Id: <1304976889-29675-34-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304976889-29675-1-git-send-email-rth@twiddle.net> References: <1304976889-29675-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.173 Subject: [Qemu-devel] [PATCH 33/35] target-alpha: Properly select the VGA controler to use. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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