From patchwork Thu Dec 29 22:12:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 709588 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tqP7s3Rmwz9sR9 for ; Fri, 30 Dec 2016 09:16:09 +1100 (AEDT) Received: from localhost ([::1]:37511 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMizX-0006HF-8O for incoming@patchwork.ozlabs.org; Thu, 29 Dec 2016 17:16:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMixv-00053Z-Mg for qemu-devel@nongnu.org; Thu, 29 Dec 2016 17:14:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMixs-0001c4-HB for qemu-devel@nongnu.org; Thu, 29 Dec 2016 17:14:27 -0500 Received: from smtp5-g21.free.fr ([212.27.42.5]:27556) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMixs-0001Zb-8a; Thu, 29 Dec 2016 17:14:24 -0500 Received: from localhost.localdomain (unknown [78.230.185.200]) by smtp5-g21.free.fr (Postfix) with ESMTP id 85AA35FF27; Thu, 29 Dec 2016 23:14:19 +0100 (CET) From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: qemu-devel@nongnu.org Date: Thu, 29 Dec 2016 23:12:11 +0100 Message-Id: <1483049536-21548-2-git-send-email-hpoussin@reactos.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1483049536-21548-1-git-send-email-hpoussin@reactos.org> References: <1483049536-21548-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 212.27.42.5 Subject: [Qemu-devel] [PATCH 1/6] pci: add pci_vga_type(), giving the device name of the chosen VGA device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Giancarlo Teodori , Thomas Huth , "Michael S. Tsirkin" , Alexander Graf , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This is in fact a split of pci_vga_init() function in two parts. Signed-off-by: Hervé Poussineau Reviewed-by: David Gibson --- hw/pci/pci.c | 22 ++++++++++++++++------ include/hw/pci/pci.h | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 24fae16..0d5a862 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1816,19 +1816,19 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, return pci_dev; } -PCIDevice *pci_vga_init(PCIBus *bus) +const char *pci_vga_type(void) { switch (vga_interface_type) { case VGA_CIRRUS: - return pci_create_simple(bus, -1, "cirrus-vga"); + return "cirrus-vga"; case VGA_QXL: - return pci_create_simple(bus, -1, "qxl-vga"); + return "qxl-vga"; case VGA_STD: - return pci_create_simple(bus, -1, "VGA"); + return "VGA"; case VGA_VMWARE: - return pci_create_simple(bus, -1, "vmware-svga"); + return "vmware-svga"; case VGA_VIRTIO: - return pci_create_simple(bus, -1, "virtio-vga"); + return "virtio-vga"; case VGA_NONE: default: /* Other non-PCI types. Checking for unsupported types is already done in vl.c. */ @@ -1836,6 +1836,16 @@ PCIDevice *pci_vga_init(PCIBus *bus) } } +PCIDevice *pci_vga_init(PCIBus *bus) +{ + const char *vga_type = pci_vga_type(); + if (vga_type) { + return pci_create_simple(bus, -1, vga_type); + } else { + return NULL; + } +} + /* Whether a given bus number is in range of the secondary * bus of the given bridge device. */ static bool pci_secondary_bus_in_range(PCIDevice *dev, int bus_num) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 772692f..aa8d014 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -420,6 +420,7 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, const char *default_model, const char *default_devaddr); +const char *pci_vga_type(void); PCIDevice *pci_vga_init(PCIBus *bus); int pci_bus_num(PCIBus *s);