From nobody Sat May 4 19:15:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510741847984778.8070744215145; Wed, 15 Nov 2017 02:30:47 -0800 (PST) Received: from localhost ([::1]:35409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEuxl-0004VE-2T for importer@patchew.org; Wed, 15 Nov 2017 05:30:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEuwv-00048I-D6 for qemu-devel@nongnu.org; Wed, 15 Nov 2017 05:29:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEuws-0002Om-7d for qemu-devel@nongnu.org; Wed, 15 Nov 2017 05:29:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33904) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eEuws-0002OI-1V for qemu-devel@nongnu.org; Wed, 15 Nov 2017 05:29:38 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB65A4E4C1 for ; Wed, 15 Nov 2017 10:29:35 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-103.ams2.redhat.com [10.36.116.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34AD89ECE6; Wed, 15 Nov 2017 10:29:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 29B98A202; Wed, 15 Nov 2017 11:29:28 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 15 Nov 2017 11:29:28 +0100 Message-Id: <20171115102928.7878-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 15 Nov 2017 10:29:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] sga: stop using sgabios rom for 2.11+ 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: Gerd Hoffmann , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" seabios 1.11 got builtin serial console support, so we don't need sgabios any more. "-machine graphics=3Doff" should be used instead. update sga.c accordingly. Signed-off-by: Gerd Hoffmann --- include/hw/compat.h | 4 ++++ hw/misc/sga.c | 26 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/include/hw/compat.h b/include/hw/compat.h index f96212c49c..1e3ad895db 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -14,6 +14,10 @@ .driver =3D "i82559a",\ .property =3D "x-use-alt-device-id",\ .value =3D "false",\ + },{\ + .driver =3D "sga",\ + .property =3D "use-sgabios",\ + .value =3D "true",\ }, =20 #define HW_COMPAT_2_9 \ diff --git a/hw/misc/sga.c b/hw/misc/sga.c index 03b006d6f0..bcb4c98554 100644 --- a/hw/misc/sga.c +++ b/hw/misc/sga.c @@ -25,6 +25,7 @@ * */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/pci/pci.h" #include "hw/i386/pc.h" #include "hw/loader.h" @@ -37,18 +38,41 @@ =20 typedef struct ISASGAState { ISADevice parent_obj; + bool use_sgabios; } ISASGAState; =20 static void sga_realizefn(DeviceState *dev, Error **errp) { - rom_add_vga(SGABIOS_FILENAME); + MachineState *machine =3D MACHINE(qdev_get_machine()); + ISASGAState *sga =3D SGA(dev); + + if (sga->use_sgabios) { + rom_add_vga(SGABIOS_FILENAME); + } else if (machine->enable_graphics) { + warn_report("sgabios is deprecated for your machine type, " + "please use -machine graphics=3Doff instead of " + "-device sga"); + rom_add_vga(SGABIOS_FILENAME); + } else { + /* + * For this machine type we expect SeaBIOS to provide a + * serial console for -machine graphics=3Doff. No need to + * do anything here. + */ + } } =20 +static Property sga_properties[] =3D { + DEFINE_PROP_BOOL("use-sgabios", ISASGAState, use_sgabios, false), + DEFINE_PROP_END_OF_LIST(), +}; + static void sga_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); + dc->props =3D sga_properties; dc->realize =3D sga_realizefn; dc->desc =3D "Serial Graphics Adapter"; } --=20 2.9.3