From patchwork Sat Sep 8 11:26:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 182555 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 45FD42C009D for ; Sat, 8 Sep 2012 22:29:24 +1000 (EST) Received: from localhost ([::1]:60291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAJCU-0004qq-ID for incoming@patchwork.ozlabs.org; Sat, 08 Sep 2012 07:27:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAJBj-00039x-4f for qemu-devel@nongnu.org; Sat, 08 Sep 2012 07:27:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAJBf-0000y7-UC for qemu-devel@nongnu.org; Sat, 08 Sep 2012 07:26:59 -0400 Received: from hall.aurel32.net ([88.191.126.93]:57350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAJBf-0000wx-M6 for qemu-devel@nongnu.org; Sat, 08 Sep 2012 07:26:55 -0400 Received: from [77.227.137.151] (helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TAJBV-0007VC-PQ; Sat, 08 Sep 2012 13:26:46 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1TAJBS-0005Re-V8; Sat, 08 Sep 2012 13:26:42 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sat, 8 Sep 2012 13:26:23 +0200 Message-Id: <1347103584-20598-12-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1347103584-20598-1-git-send-email-aurelien@aurel32.net> References: <1347103584-20598-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.126.93 Cc: Anthony Liguori , Aurelien Jarno Subject: [Qemu-devel] [PATCH 11/12] pc: use the new pci_vga_init() function 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 CONFIG_SPICE is now tested in vl.c and thus not needed anymore. The various tests are still needed for the ISA cases. Cc: Anthony Liguori Signed-off-by: Aurelien Jarno --- hw/pc.c | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 8736a30..8cdbd9e 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -27,7 +27,6 @@ #include "fdc.h" #include "ide.h" #include "pci.h" -#include "vmware_vga.h" #include "monitor.h" #include "fw_cfg.h" #include "hpet_emul.h" @@ -51,7 +50,6 @@ #include "exec-memory.h" #include "arch_init.h" #include "bitmap.h" -#include "vga-pci.h" /* output Bochs bios info messages */ //#define DEBUG_BIOS @@ -1019,34 +1017,25 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus) { DeviceState *dev = NULL; - if (cirrus_vga_enabled) { - if (pci_bus) { - dev = pci_cirrus_vga_init(pci_bus); - } else { + if (pci_bus) { + PCIDevice *pcidev = pci_vga_init(pci_bus); + dev = pcidev ? &pcidev->qdev : NULL; + } else { + switch (vga_interface_type) { + case VGA_CIRRUS: dev = &isa_create_simple(isa_bus, "isa-cirrus-vga")->qdev; - } - } else if (vmsvga_enabled) { - if (pci_bus) { - dev = pci_vmsvga_init(pci_bus); - } else { - fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__); - } -#ifdef CONFIG_SPICE - } else if (qxl_enabled) { - if (pci_bus) { - dev = &pci_create_simple(pci_bus, -1, "qxl-vga")->qdev; - } else { - fprintf(stderr, "%s: qxl: no PCI bus\n", __FUNCTION__); - } -#endif - } else if (std_vga_enabled) { - if (pci_bus) { - dev = pci_std_vga_init(pci_bus); - } else { + break; + case VGA_QXL: + fprintf(stderr, "%s: qxl: no PCI bus\n", __func__); + break; + case VGA_STD: dev = isa_vga_init(isa_bus); + break; + case VGA_VMWARE: + fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __func__); + break; } } - return dev; }