From patchwork Tue Sep 11 19:10:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 183192 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 7F4652C0089 for ; Wed, 12 Sep 2012 06:12:56 +1000 (EST) Received: from localhost ([::1]:50994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBWpK-0008Tg-H8 for incoming@patchwork.ozlabs.org; Tue, 11 Sep 2012 16:12:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBWVm-0004wz-3I for qemu-devel@nongnu.org; Tue, 11 Sep 2012 15:52:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBWVh-0000q0-KO for qemu-devel@nongnu.org; Tue, 11 Sep 2012 15:52:42 -0400 Received: from hall.aurel32.net ([88.191.126.93]:42697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBWVh-0000pu-Dv for qemu-devel@nongnu.org; Tue, 11 Sep 2012 15:52:37 -0400 Received: from [37.160.6.220] (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 1TBWVg-0005ZT-F6; Tue, 11 Sep 2012 21:52:36 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1TBVrB-0004sr-7b; Tue, 11 Sep 2012 21:10:45 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Tue, 11 Sep 2012 21:10:32 +0200 Message-Id: <1347390642-17434-8-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1347390642-17434-1-git-send-email-aurelien@aurel32.net> References: <1347390642-17434-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: Aurelien Jarno Subject: [Qemu-devel] [PATCH v3 07/17] isa: add a isa_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 This function create a ISA VGA device according to the value of vga_interface_type. It returns a ISADevice (and not a DeviceState). Signed-off-by: Aurelien Jarno --- hw/isa-bus.c | 20 ++++++++++++++++++++ hw/isa.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index f9b2373..00de20a 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -19,6 +19,7 @@ #include "hw.h" #include "monitor.h" #include "sysbus.h" +#include "sysemu.h" #include "isa.h" #include "exec-memory.h" @@ -166,6 +167,25 @@ ISADevice *isa_create_simple(ISABus *bus, const char *name) return dev; } +ISADevice *isa_vga_init(ISABus *bus) +{ + switch (vga_interface_type) { + case VGA_CIRRUS: + return isa_create_simple(bus, "isa-cirrus-vga"); + case VGA_QXL: + fprintf(stderr, "%s: qxl: no PCI bus\n", __func__); + return NULL; + case VGA_STD: + return isa_create_simple(bus, "isa-vga"); + case VGA_VMWARE: + fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __func__); + return NULL; + case VGA_NONE: + default: + return NULL; + } +} + static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent) { ISADevice *d = ISA_DEVICE(dev); diff --git a/hw/isa.h b/hw/isa.h index dc97052..8fb498a 100644 --- a/hw/isa.h +++ b/hw/isa.h @@ -47,6 +47,8 @@ ISADevice *isa_create(ISABus *bus, const char *name); ISADevice *isa_try_create(ISABus *bus, const char *name); ISADevice *isa_create_simple(ISABus *bus, const char *name); +ISADevice *isa_vga_init(ISABus *bus); + /** * isa_register_ioport: Install an I/O port region on the ISA bus. *