From nobody Thu Apr 18 05:22:51 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.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 1487604699378712.1038954108323; Mon, 20 Feb 2017 07:31:39 -0800 (PST) Received: from localhost ([::1]:39216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfpw8-0001PO-QQ for importer@patchew.org; Mon, 20 Feb 2017 10:31:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfpiD-0005hp-F6 for qemu-devel@nongnu.org; Mon, 20 Feb 2017 10:17:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfpi9-0006fw-UO for qemu-devel@nongnu.org; Mon, 20 Feb 2017 10:17:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60456) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cfpi9-0006fQ-Lu for qemu-devel@nongnu.org; Mon, 20 Feb 2017 10:17:09 -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 C65E74E33C for ; Mon, 20 Feb 2017 15:17:08 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-71.ams2.redhat.com [10.36.116.71]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1KFH759014989; Mon, 20 Feb 2017 10:17:08 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 7B64C8089D; Mon, 20 Feb 2017 16:17:05 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 20 Feb 2017 16:16:03 +0100 Message-Id: <1487603763-14932-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.38]); Mon, 20 Feb 2017 15:17:08 +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] [RfC PATCH] vga: wire up -g x switch for virtio and qxl 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: "Michael S. Tsirkin" , Gerd Hoffmann , "Dr. David Alan Gilbert" 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" FIXME: qxl not working yet. Cc: Dr. David Alan Gilbert Signed-off-by: Gerd Hoffmann --- arch_init.c | 8 ++++++-- hw/display/qxl.c | 18 ++++++++++++++++++ hw/display/virtio-gpu.c | 9 +++++++-- qemu-options.hx | 6 ++++-- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/arch_init.c b/arch_init.c index 0810116..9cd3dfc 100644 --- a/arch_init.c +++ b/arch_init.c @@ -34,14 +34,18 @@ #include "hw/acpi/acpi.h" #include "qemu/help_option.h" =20 -#ifdef TARGET_SPARC +#if defined(TARGET_SPARC) int graphic_width =3D 1024; int graphic_height =3D 768; int graphic_depth =3D 8; -#else +#elif defined(TARGET_PPC) int graphic_width =3D 800; int graphic_height =3D 600; int graphic_depth =3D 32; +#else +int graphic_width; +int graphic_height; +int graphic_depth; #endif =20 =20 diff --git a/hw/display/qxl.c b/hw/display/qxl.c index af4c0ca..c29ee7b 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -368,6 +368,24 @@ 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 0 + /* + * FIXME: + * + * Not working that simple. Seems the driver doesn't check this + * without notification. So we have to try something more clever, + * and pay attention that we don't screw up the spice guest agent + * monitor configuration ... + */ + if (graphic_width && graphic_height) { + 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 graphic_width; + rom->client_monitors_config.heads[0].bottom =3D graphic_height; + } +#endif + d->shadow_rom =3D *rom; d->rom =3D rom; d->modes =3D modes; 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 */ diff --git a/qemu-options.hx b/qemu-options.hx index 5633d39..734a87b 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1233,11 +1233,13 @@ 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 -Set the initial graphical resolution and depth (PPC, SPARC only). +Set the initial graphical resolution and depth. +On PPC and SPARC the firmware will configure the display accordingly. +On other archs this is supported by virtio and qxl (FIXME) display adapter= s. ETEXI =20 DEF("vnc", HAS_ARG, QEMU_OPTION_vnc , --=20 1.8.3.1