From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487715702662206.81353183411989; Tue, 21 Feb 2017 14:21:42 -0800 (PST) Received: from localhost ([::1]:48862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIoX-00006J-FO for importer@patchew.org; Tue, 21 Feb 2017 17:21:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002qd-CG for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiH-0004Rx-6F for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiH-0004Rd-0R for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:13 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18E1480462 for ; Tue, 21 Feb 2017 22:15:13 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LMFBfZ003885; Tue, 21 Feb 2017 17:15:12 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id D692780A03; Tue, 21 Feb 2017 23:15:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:51 +0100 Message-Id: <1487715299-21102-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 21 Feb 2017 22:15:13 +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 1/9] sysemu: add defines for sparc & ppc graphics_* 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 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" Add defines for the sparc and ppc arch specific graphics defaults. They return the graphic_* values these variables are non-zero, and the default values otherwise. After switching over ppc and sparc to use these we don't need the arch-specific initialization for the graphic_* variables any more. Signed-off-by: Gerd Hoffmann --- include/sysemu/sysemu.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 576c7ce..9450788 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -142,9 +142,16 @@ typedef enum { extern int vga_interface_type; #define xenfb_enabled (vga_interface_type =3D=3D VGA_XENFB) =20 +#define sparc_graphic_width (graphic_width ? graphic_width : 1024) +#define sparc_graphic_height (graphic_height ? graphic_height : 768) +#define sparc_graphic_depth (graphic_depth ? graphic_depth : 8) +#define ppc_graphic_width (graphic_width ? graphic_width : 800) +#define ppc_graphic_height (graphic_height ? graphic_height : 600) +#define ppc_graphic_depth (graphic_depth ? graphic_depth : 32) extern int graphic_width; extern int graphic_height; extern int graphic_depth; + extern int display_opengl; extern const char *keyboard_layout; extern int win2k_install_hack; --=20 1.8.3.1 From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 148771544135299.49693771599891; Tue, 21 Feb 2017 14:17:21 -0800 (PST) Received: from localhost ([::1]:48831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIkK-00040B-4x for importer@patchew.org; Tue, 21 Feb 2017 17:17:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002qe-Cg for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiH-0004SX-Vv for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44268) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiH-0004Rr-N5 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:13 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C15B8C0092D5; Tue, 21 Feb 2017 22:15:13 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LMFBP4003882; Tue, 21 Feb 2017 17:15:12 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id F345780F44; Tue, 21 Feb 2017 23:15:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:52 +0100 Message-Id: <1487715299-21102-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 21 Feb 2017 22:15:13 +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 2/9] sparc: use sparc_graphic_* defines 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: Mark Cave-Ayland , Gerd Hoffmann , Artyom Tarasenko 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" This switches over sparc to use the new sparc_graphic_* defines. Signed-off-by: Gerd Hoffmann --- hw/sparc/sun4m.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index f5b6efd..1aaad68 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -908,43 +908,43 @@ static void sun4m_hw_init(const struct sun4m_hwdef *h= wdef, ledma =3D sparc32_dma_init(hwdef->dma_base + 16ULL, slavio_irq[16], iommu, &ledma_irq, 1); =20 - if (graphic_depth !=3D 8 && graphic_depth !=3D 24) { - error_report("Unsupported depth: %d", graphic_depth); + if (sparc_graphic_depth !=3D 8 && sparc_graphic_depth !=3D 24) { + error_report("Unsupported depth: %d", sparc_graphic_depth); exit (1); } num_vsimms =3D 0; if (num_vsimms =3D=3D 0) { if (vga_interface_type =3D=3D VGA_CG3) { - if (graphic_depth !=3D 8) { - error_report("Unsupported depth: %d", graphic_depth); + if (sparc_graphic_depth !=3D 8) { + error_report("Unsupported depth: %d", sparc_graphic_depth); exit(1); } =20 - if (!(graphic_width =3D=3D 1024 && graphic_height =3D=3D 768) = && - !(graphic_width =3D=3D 1152 && graphic_height =3D=3D 900))= { - error_report("Unsupported resolution: %d x %d", graphic_wi= dth, - graphic_height); + if (!(sparc_graphic_width =3D=3D 1024 && sparc_graphic_height = =3D=3D 768) && + !(sparc_graphic_width =3D=3D 1152 && sparc_graphic_height = =3D=3D 900)) { + error_report("Unsupported resolution: %d x %d", sparc_grap= hic_width, + sparc_graphic_height); exit(1); } =20 /* sbus irq 5 */ cg3_init(hwdef->tcx_base, slavio_irq[11], 0x00100000, - graphic_width, graphic_height, graphic_depth); + sparc_graphic_width, sparc_graphic_height, sparc_grap= hic_depth); } else { /* If no display specified, default to TCX */ - if (graphic_depth !=3D 8 && graphic_depth !=3D 24) { - error_report("Unsupported depth: %d", graphic_depth); + if (sparc_graphic_depth !=3D 8 && sparc_graphic_depth !=3D 24)= { + error_report("Unsupported depth: %d", sparc_graphic_depth); exit(1); } =20 - if (!(graphic_width =3D=3D 1024 && graphic_height =3D=3D 768))= { + if (!(sparc_graphic_width =3D=3D 1024 && sparc_graphic_height = =3D=3D 768)) { error_report("Unsupported resolution: %d x %d", - graphic_width, graphic_height); + sparc_graphic_width, sparc_graphic_height); exit(1); } =20 tcx_init(hwdef->tcx_base, slavio_irq[11], 0x00100000, - graphic_width, graphic_height, graphic_depth); + sparc_graphic_width, sparc_graphic_height, sparc_grap= hic_depth); } } =20 @@ -1025,7 +1025,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *h= wdef, =20 nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, machine->kernel_cmd= line, machine->boot_order, machine->ram_size, kernel_size, - graphic_width, graphic_height, graphic_depth, + sparc_graphic_width, sparc_graphic_height, sparc_graphic_de= pth, hwdef->nvram_machine_id, "Sun4m"); =20 if (hwdef->ecc_base) @@ -1037,9 +1037,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *h= wdef, fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id); - fw_cfg_add_i16(fw_cfg, FW_CFG_SUN4M_DEPTH, graphic_depth); - fw_cfg_add_i16(fw_cfg, FW_CFG_SUN4M_WIDTH, graphic_width); - fw_cfg_add_i16(fw_cfg, FW_CFG_SUN4M_HEIGHT, graphic_height); + fw_cfg_add_i16(fw_cfg, FW_CFG_SUN4M_DEPTH, sparc_graphic_depth); + fw_cfg_add_i16(fw_cfg, FW_CFG_SUN4M_WIDTH, sparc_graphic_width); + fw_cfg_add_i16(fw_cfg, FW_CFG_SUN4M_HEIGHT, sparc_graphic_height); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, KERNEL_LOAD_ADDR); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); if (machine->kernel_cmdline) { --=20 1.8.3.1 From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487715908300250.01917523025963; Tue, 21 Feb 2017 14:25:08 -0800 (PST) Received: from localhost ([::1]:48879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIrq-0003fU-OI for importer@patchew.org; Tue, 21 Feb 2017 17:25:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002qf-Ci for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiH-0004SH-J7 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52244) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiH-0004Rn-AX; Tue, 21 Feb 2017 17:15:13 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C2E781129; Tue, 21 Feb 2017 22:15:13 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D46097798; Tue, 21 Feb 2017 22:15:12 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 259D080F76; Tue, 21 Feb 2017 23:15:10 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:53 +0100 Message-Id: <1487715299-21102-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 21 Feb 2017 22:15:13 +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 3/9] ppc: use ppc_graphic_* defines 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: "open list:New World" , David Gibson , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gerd Hoffmann , Alexander Graf 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" This switches over ppc to use the new ppc_graphic_* defines. Signed-off-by: Gerd Hoffmann Reviewed-by: David Gibson Reviewed-by: Herv=C3=A9 Poussineau --- hw/ppc/mac_newworld.c | 6 +++--- hw/ppc/mac_oldworld.c | 6 +++--- hw/ppc/prep.c | 10 +++++----- hw/ppc/spapr.c | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 2bfdb64..4722277 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -482,9 +482,9 @@ static void ppc_core99_init(MachineState *machine) fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, ppc_boot_device); =20 - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width); - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height); - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, ppc_graphic_width); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, ppc_graphic_height); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, ppc_graphic_depth); =20 fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled()); if (kvm_enabled()) { diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 56282c5..a79f011 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -335,9 +335,9 @@ static void ppc_heathrow_init(MachineState *machine) fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, ppc_boot_device); =20 - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width); - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height); - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, ppc_graphic_width); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, ppc_graphic_height); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, ppc_graphic_depth); =20 fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled()); if (kvm_enabled()) { diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index ca7959c..82bf6b5 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -677,7 +677,7 @@ static void ppc_prep_init(MachineState *machine) initrd_base, initrd_size, /* XXX: need an option to load a NVRAM image */ 0, - graphic_width, graphic_height, graphic_depth); + ppc_graphic_width, ppc_graphic_height, ppc_graphi= c_depth); } =20 static void prep_machine_init(MachineClass *mc) @@ -861,9 +861,9 @@ static void ibm_40p_init(MachineState *machine) fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_PREP); =20 - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width); - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height); - fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, ppc_graphic_width); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, ppc_graphic_height); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, ppc_graphic_depth); =20 fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled()); if (kvm_enabled()) { @@ -891,7 +891,7 @@ static void ibm_40p_init(MachineState *machine) initrd_base, initrd_size, /* XXX: need an option to load a NVRAM image = */ 0, - graphic_width, graphic_height, graphic_depth); + ppc_graphic_width, ppc_graphic_height, ppc_gr= aphic_depth); } } =20 diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e465d7a..ba8f81e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -824,9 +824,9 @@ static void spapr_dt_chosen(sPAPRMachineState *spapr, v= oid *fdt) if (boot_menu) { _FDT((fdt_setprop_cell(fdt, chosen, "qemu,boot-menu", boot_menu))); } - _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-width", graphic_width= )); - _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-height", graphic_heig= ht)); - _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-depth", graphic_depth= )); + _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-width", ppc_graphic_w= idth)); + _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-height", ppc_graphic_= height)); + _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-depth", ppc_graphic_d= epth)); =20 if (cb && bootlist) { int i; --=20 1.8.3.1 From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 14877157034851001.0401032156282; Tue, 21 Feb 2017 14:21:43 -0800 (PST) Received: from localhost ([::1]:48863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIoY-00006r-8S for importer@patchew.org; Tue, 21 Feb 2017 17:21:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002qi-DQ for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiH-0004S7-88 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42378) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiH-0004Rj-2k for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:13 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E3FA4E326 for ; Tue, 21 Feb 2017 22:15:13 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LMFBr3024897; Tue, 21 Feb 2017 17:15:12 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 439F180E82; Tue, 21 Feb 2017 23:15:10 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:54 +0100 Message-Id: <1487715299-21102-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 21 Feb 2017 22:15:13 +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 4/9] drop arch-specific graphic_* initialization. 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: Paolo Bonzini , Gerd Hoffmann 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" Now that sparc and ppc can deal with uninitialized graphic_* variables we can drop the #ifdefs and also move the variables out of arch_init.c as they are not arch specific any more. Signed-off-by: Gerd Hoffmann --- arch_init.c | 11 ----------- vl.c | 3 +++ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/arch_init.c b/arch_init.c index 0810116..f41af1c 100644 --- a/arch_init.c +++ b/arch_init.c @@ -34,17 +34,6 @@ #include "hw/acpi/acpi.h" #include "qemu/help_option.h" =20 -#ifdef TARGET_SPARC -int graphic_width =3D 1024; -int graphic_height =3D 768; -int graphic_depth =3D 8; -#else -int graphic_width =3D 800; -int graphic_height =3D 600; -int graphic_depth =3D 32; -#endif - - #if defined(TARGET_ALPHA) #define QEMU_ARCH QEMU_ARCH_ALPHA #elif defined(TARGET_ARM) diff --git a/vl.c b/vl.c index 27d9829..3be883e 100644 --- a/vl.c +++ b/vl.c @@ -135,6 +135,9 @@ const char *bios_name =3D NULL; enum vga_retrace_method vga_retrace_method =3D VGA_RETRACE_DUMB; int request_opengl =3D -1; int display_opengl; +int graphic_width; +int graphic_height; +int graphic_depth; const char* keyboard_layout =3D NULL; ram_addr_t ram_size; const char *mem_path =3D NULL; --=20 1.8.3.1 From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487715441168146.9478643836709; Tue, 21 Feb 2017 14:17:21 -0800 (PST) Received: from localhost ([::1]:48830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIkJ-0003zx-Om for importer@patchew.org; Tue, 21 Feb 2017 17:17:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002qh-DB for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiI-0004Sq-M1 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43224) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiI-0004SN-Gg for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:14 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B5C25C04BD2E for ; Tue, 21 Feb 2017 22:15:14 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LMFDaZ024918; Tue, 21 Feb 2017 17:15:14 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 556C480FD5; Tue, 21 Feb 2017 23:15:10 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:55 +0100 Message-Id: <1487715299-21102-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 21 Feb 2017 22:15:14 +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 5/9] enable -g command line switch for all archs 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 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" Virtual display adapters will learn to use graphic_* variables (which are set by the -g switch), so enable this for all archs. RfC: Maybe restrict to PCI-capable archs? Or would that be pretty much anything anyway? Signed-off-by: Gerd Hoffmann --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 809b2b0..4e89610 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1237,7 +1237,7 @@ ETEXI =20 DEF("g", 1, QEMU_OPTION_g , "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n", - QEMU_ARCH_PPC | QEMU_ARCH_SPARC) + QEMU_ARCH_ALL) STEXI @item -g @var{width}x@var{height}[x@var{depth}] @findex -g --=20 1.8.3.1 From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487715438363363.85638905552685; Tue, 21 Feb 2017 14:17:18 -0800 (PST) Received: from localhost ([::1]:48828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIkG-0003wn-D7 for importer@patchew.org; Tue, 21 Feb 2017 17:17:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002qc-C0 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiI-0004Sv-Mh for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58416) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiI-0004SU-HN for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:14 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C293A3B721 for ; Tue, 21 Feb 2017 22:15:14 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LMFDrk020140; Tue, 21 Feb 2017 17:15:14 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 6F5DA80FD8; Tue, 21 Feb 2017 23:15:10 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:56 +0100 Message-Id: <1487715299-21102-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 21 Feb 2017 22:15:14 +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 6/9] virtio-gpu: use graphic_* variables. 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" If graphic_* variables are set (via -g switch), pass on that information to the guest so the driver can use it. Signed-off-by: Gerd Hoffmann --- hw/display/virtio-gpu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 9b530ab..04ba221 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1170,8 +1170,13 @@ static void virtio_gpu_device_realize(DeviceState *q= dev, Error **errp) virtio_init(VIRTIO_DEVICE(g), "virtio-gpu", VIRTIO_ID_GPU, g->config_size); =20 - g->req_state[0].width =3D 1024; - g->req_state[0].height =3D 768; + if (graphic_width && graphic_height) { + g->req_state[0].width =3D graphic_width; + g->req_state[0].height =3D graphic_height; + } else { + g->req_state[0].width =3D 1024; + g->req_state[0].height =3D 768; + } =20 if (virtio_gpu_virgl_enabled(g->conf)) { /* use larger control queue in 3d mode */ --=20 1.8.3.1 From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487715906516985.9542666691539; Tue, 21 Feb 2017 14:25:06 -0800 (PST) Received: from localhost ([::1]:48878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIrp-0003eR-4m for importer@patchew.org; Tue, 21 Feb 2017 17:25:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002qj-E2 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiI-0004T1-Ol for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42900) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiI-0004SQ-Hf for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:14 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8C607FB63 for ; Tue, 21 Feb 2017 22:15:14 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LMFDmH024920; Tue, 21 Feb 2017 17:15:14 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 88E7F80FCD; Tue, 21 Feb 2017 23:15:10 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:57 +0100 Message-Id: <1487715299-21102-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Feb 2017 22:15:14 +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 7/9] qxl: use graphic_* variables. 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 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" If graphic_* variables are set (via -g switch), pass on that information to the guest so the driver can use it. Also move up qxl_crc32() function so we don't need a forward declaration. Additionally guest driver updates are needed so the guest driver will actually pick this up, which will probably land in linux kernel 4.12. Signed-off-by: Gerd Hoffmann --- hw/display/qxl.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index af4c0ca..37c84a8 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -304,6 +304,16 @@ void qxl_spice_reset_cursor(PCIQXLDevice *qxl) qxl->ssd.cursor =3D cursor_builtin_hidden(); } =20 +static uint32_t qxl_crc32(const uint8_t *p, unsigned len) +{ + /* + * zlib xors the seed with 0xffffffff, and xors the result + * again with 0xffffffff; Both are not done with linux's crc32, + * which we want to be compatible with, so undo that. + */ + return crc32(0xffffffff, p, len) ^ 0xffffffff; +} + static ram_addr_t qxl_rom_size(void) { #define QXL_REQUIRED_SZ (sizeof(QXLRom) + sizeof(QXLModes) + sizeof(qxl_mo= des)) @@ -368,6 +378,18 @@ static void init_qxl_rom(PCIQXLDevice *d) rom->num_pages =3D cpu_to_le32(num_pages); rom->ram_header_offset =3D cpu_to_le32(d->vga.vram_size - ram_header_= size); =20 + if (graphic_width && graphic_height) { + /* needs linux kernel 4.12+ to work */ + rom->client_monitors_config.count =3D 1; + rom->client_monitors_config.heads[0].left =3D 0; + rom->client_monitors_config.heads[0].top =3D 0; + rom->client_monitors_config.heads[0].right =3D cpu_to_le32(graphic= _width); + rom->client_monitors_config.heads[0].bottom =3D cpu_to_le32(graphi= c_height); + rom->client_monitors_config_crc =3D qxl_crc32( + (const uint8_t *)&rom->client_monitors_config, + sizeof(rom->client_monitors_config)); + } + d->shadow_rom =3D *rom; d->rom =3D rom; d->modes =3D modes; @@ -981,16 +1003,6 @@ static void interface_set_client_capabilities(QXLInst= ance *sin, qxl_send_events(qxl, QXL_INTERRUPT_CLIENT); } =20 -static uint32_t qxl_crc32(const uint8_t *p, unsigned len) -{ - /* - * zlib xors the seed with 0xffffffff, and xors the result - * again with 0xffffffff; Both are not done with linux's crc32, - * which we want to be compatible with, so undo that. - */ - return crc32(0xffffffff, p, len) ^ 0xffffffff; -} - static bool qxl_rom_monitors_config_changed(QXLRom *rom, VDAgentMonitorsConfig *monitors_config, unsigned int max_outputs) --=20 1.8.3.1 From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487715441155980.7685726108165; Tue, 21 Feb 2017 14:17:21 -0800 (PST) Received: from localhost ([::1]:48829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIkJ-0003yf-N1 for importer@patchew.org; Tue, 21 Feb 2017 17:17:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002qk-Fq for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiI-0004T8-QE for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41664) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiI-0004Sb-Kw for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:14 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C421E80461 for ; Tue, 21 Feb 2017 22:15:14 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LMFDh6024922; Tue, 21 Feb 2017 17:15:14 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id A46C881005; Tue, 21 Feb 2017 23:15:10 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:58 +0100 Message-Id: <1487715299-21102-9-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 21 Feb 2017 22:15:14 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 8/9] update -g command line switch documentation 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Bring documentation in line with the recent changes. Text suggested by L=C3=A1szl=C3=B3 =C3=89rsek. Signed-off-by: Gerd Hoffmann Reviewed-by: Laszlo Ersek --- qemu-options.hx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 4e89610..ae62e0d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1241,7 +1241,18 @@ DEF("g", 1, QEMU_OPTION_g , STEXI @item -g @var{width}x@var{height}[x@var{depth}] @findex -g -Set the initial graphical resolution and depth (PPC, SPARC only). +Set the initial graphical resolution and depth. + +This setting may be masked by guest firmware temporarily. + +On PPC and SPARC, the guest firmware will configure the display from +this setting, and the guest OS will inherit the display resolution +and depth. + +On x86 and ARM, if the guest firmware is an edk2 (UEFI) platform, +the firmware may initially configure the display according to its own, +persistent, independent settings. The guest OS drivers, once loaded, +should adhere to "-g" however, for virtio and qxl adapters. ETEXI =20 DEF("vnc", HAS_ARG, QEMU_OPTION_vnc , --=20 1.8.3.1 From nobody Thu Nov 6 18:52:25 2025 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487716106079918.4160895524843; Tue, 21 Feb 2017 14:28:26 -0800 (PST) Received: from localhost ([::1]:48905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIv2-0007DO-RF for importer@patchew.org; Tue, 21 Feb 2017 17:28:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgIiK-0002ql-JM for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgIiJ-0004TR-6Q for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33124) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgIiI-0004Sh-Uc for qemu-devel@nongnu.org; Tue, 21 Feb 2017 17:15:15 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F71F61D03 for ; Tue, 21 Feb 2017 22:15:15 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LMFDBL020142; Tue, 21 Feb 2017 17:15:14 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id B917C81080; Tue, 21 Feb 2017 23:15:10 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 23:14:59 +0100 Message-Id: <1487715299-21102-10-git-send-email-kraxel@redhat.com> In-Reply-To: <1487715299-21102-1-git-send-email-kraxel@redhat.com> References: <1487715299-21102-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 21 Feb 2017 22:15:15 +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 9/9] [RfC] stdvga: use graphic_* variables. 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" Add two new registers to the qemu extended register range, carrying the suggested width and height of the display device. In case the graphic_* variables are set (via -g switch), fill these new registers accordingly. Additionally guest driver updates are needed to support the new registers. These changes will probably land in linux kernel 4.12. TODO: add compat properties to turn off qemu-display-size for machine types older than 2.9-or-10 Signed-off-by: Gerd Hoffmann --- hw/display/vga-pci.c | 52 ++++++++++++++++++++++++++++++++++-----------= ---- hw/display/vga_int.h | 4 ++-- hw/display/virtio-vga.c | 3 ++- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index ac9a764..78e00df 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -31,23 +31,28 @@ #include "ui/pixel_ops.h" #include "qemu/timer.h" #include "hw/loader.h" +#include "sysemu/sysemu.h" =20 #define PCI_VGA_IOPORT_OFFSET 0x400 #define PCI_VGA_IOPORT_SIZE (0x3e0 - 0x3c0) #define PCI_VGA_BOCHS_OFFSET 0x500 #define PCI_VGA_BOCHS_SIZE (0x0b * 2) #define PCI_VGA_QEXT_OFFSET 0x600 -#define PCI_VGA_QEXT_SIZE (2 * 4) +#define PCI_VGA_QEXT_SIZE_V1 (2 * 4) +#define PCI_VGA_QEXT_SIZE_V2 (4 * 4) #define PCI_VGA_MMIO_SIZE 0x1000 =20 #define PCI_VGA_QEXT_REG_SIZE (0 * 4) #define PCI_VGA_QEXT_REG_BYTEORDER (1 * 4) #define PCI_VGA_QEXT_LITTLE_ENDIAN 0x1e1e1e1e #define PCI_VGA_QEXT_BIG_ENDIAN 0xbebebebe +#define PCI_VGA_QEXT_REG_WIDTH (2 * 4) +#define PCI_VGA_QEXT_REG_HEIGHT (3 * 4) =20 enum vga_pci_flags { - PCI_VGA_FLAG_ENABLE_MMIO =3D 1, - PCI_VGA_FLAG_ENABLE_QEXT =3D 2, + PCI_VGA_FLAG_ENABLE_MMIO =3D 1, + PCI_VGA_FLAG_ENABLE_QEXT =3D 2, + PCI_VGA_FLAG_ENABLE_QEXT_V2 =3D 3, }; =20 typedef struct PCIVGAState { @@ -157,10 +162,14 @@ static uint64_t pci_vga_qext_read(void *ptr, hwaddr a= ddr, unsigned size) =20 switch (addr) { case PCI_VGA_QEXT_REG_SIZE: - return PCI_VGA_QEXT_SIZE; + return s->qext_size; case PCI_VGA_QEXT_REG_BYTEORDER: return s->big_endian_fb ? PCI_VGA_QEXT_BIG_ENDIAN : PCI_VGA_QEXT_LITTLE_ENDIAN; + case PCI_VGA_QEXT_REG_WIDTH: + return graphic_width; + case PCI_VGA_QEXT_REG_HEIGHT: + return graphic_height; default: return 0; } @@ -207,8 +216,7 @@ static const MemoryRegionOps pci_vga_qext_ops =3D { =20 void pci_std_vga_mmio_region_init(VGACommonState *s, MemoryRegion *parent, - MemoryRegion *subs, - bool qext) + MemoryRegion *subs) { memory_region_init_io(&subs[0], NULL, &pci_vga_ioport_ops, s, "vga ioports remapped", PCI_VGA_IOPORT_SIZE); @@ -220,9 +228,9 @@ void pci_std_vga_mmio_region_init(VGACommonState *s, memory_region_add_subregion(parent, PCI_VGA_BOCHS_OFFSET, &subs[1]); =20 - if (qext) { + if (s->qext_size) { memory_region_init_io(&subs[2], NULL, &pci_vga_qext_ops, s, - "qemu extended regs", PCI_VGA_QEXT_SIZE); + "qemu extended regs", s->qext_size); memory_region_add_subregion(parent, PCI_VGA_QEXT_OFFSET, &subs[2]); } @@ -232,7 +240,6 @@ static void pci_std_vga_realize(PCIDevice *dev, Error *= *errp) { PCIVGAState *d =3D PCI_VGA(dev); VGACommonState *s =3D &d->vga; - bool qext =3D false; =20 /* vga + console init */ vga_common_init(s, OBJECT(dev), true); @@ -249,10 +256,15 @@ static void pci_std_vga_realize(PCIDevice *dev, Error= **errp) memory_region_init(&d->mmio, NULL, "vga.mmio", 4096); =20 if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) { - qext =3D true; - pci_set_byte(&d->dev.config[PCI_REVISION_ID], 2); + if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT_V2)) { + s->qext_size =3D PCI_VGA_QEXT_SIZE_V2; + pci_set_byte(&d->dev.config[PCI_REVISION_ID], 3); + } else { + s->qext_size =3D PCI_VGA_QEXT_SIZE_V1; + pci_set_byte(&d->dev.config[PCI_REVISION_ID], 2); + } } - pci_std_vga_mmio_region_init(s, &d->mmio, d->mrs, qext); + pci_std_vga_mmio_region_init(s, &d->mmio, d->mrs); =20 pci_register_bar(&d->dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &d->mm= io); } @@ -274,7 +286,6 @@ static void pci_secondary_vga_realize(PCIDevice *dev, E= rror **errp) { PCIVGAState *d =3D PCI_VGA(dev); VGACommonState *s =3D &d->vga; - bool qext =3D false; =20 /* vga + console init */ vga_common_init(s, OBJECT(dev), false); @@ -284,10 +295,15 @@ static void pci_secondary_vga_realize(PCIDevice *dev,= Error **errp) memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio", 4096); =20 if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) { - qext =3D true; - pci_set_byte(&d->dev.config[PCI_REVISION_ID], 2); + if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT_V2)) { + s->qext_size =3D PCI_VGA_QEXT_SIZE_V2; + pci_set_byte(&d->dev.config[PCI_REVISION_ID], 3); + } else { + s->qext_size =3D PCI_VGA_QEXT_SIZE_V1; + pci_set_byte(&d->dev.config[PCI_REVISION_ID], 2); + } } - pci_std_vga_mmio_region_init(s, &d->mmio, d->mrs, qext); + pci_std_vga_mmio_region_init(s, &d->mmio, d->mrs); =20 pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->vram); pci_register_bar(&d->dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &d->mmio); @@ -311,6 +327,8 @@ static Property vga_pci_properties[] =3D { DEFINE_PROP_BIT("mmio", PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_MMIO, = true), DEFINE_PROP_BIT("qemu-extended-regs", PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_QEXT, true), + DEFINE_PROP_BIT("qemu-display-size", + PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_QEXT_V2, true), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -318,6 +336,8 @@ static Property secondary_pci_properties[] =3D { DEFINE_PROP_UINT32("vgamem_mb", PCIVGAState, vga.vram_size_mb, 16), DEFINE_PROP_BIT("qemu-extended-regs", PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_QEXT, true), + DEFINE_PROP_BIT("qemu-display-size", + PCIVGAState, flags, PCI_VGA_FLAG_ENABLE_QEXT_V2, true), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h index dd6c958..51217cf 100644 --- a/hw/display/vga_int.h +++ b/hw/display/vga_int.h @@ -162,6 +162,7 @@ typedef struct VGACommonState { bool full_update_gfx; bool big_endian_fb; bool default_endian_fb; + uint32_t qext_size; /* hardware mouse cursor support */ uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32]; uint32_t hw_cursor_x; @@ -223,7 +224,6 @@ extern const MemoryRegionOps vga_mem_ops; /* vga-pci.c */ void pci_std_vga_mmio_region_init(VGACommonState *s, MemoryRegion *parent, - MemoryRegion *subs, - bool qext); + MemoryRegion *subs); =20 #endif diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index f9b017d..8684dc0 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -153,8 +153,9 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev= , Error **errp) } =20 /* add stdvga mmio regions */ + vga->qext_size =3D 2 * 4; /* PCI_VGA_QEXT_SIZE_V1 */ pci_std_vga_mmio_region_init(vga, &vpci_dev->modern_bar, - vvga->vga_mrs, true); + vvga->vga_mrs); =20 vga->con =3D g->scanout[0].con; graphic_console_set_hwops(vga->con, &virtio_vga_ops, vvga); --=20 1.8.3.1