From nobody Sat Nov 23 09:39:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1728732900048827.7163738647764; Sat, 12 Oct 2024 04:35:00 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id CA120ED870; Sat, 12 Oct 2024 11:34:53 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 80DEAED859 for ; Sat, 12 Oct 2024 11:34:36 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) 2024-10-12 11:34:34.682050291 +0000 UTC m=+2569031.547703105 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by geopod-ismtpd-6 (SG) with ESMTP id 71UxACTDT2aKeJ2kNgkhMg Sat, 12 Oct 2024 11:34:34.486 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by custard.lan with esmtp (Exim 4.96) (envelope-from ) id 1szaOH-0008EU-1L; Sat, 12 Oct 2024 12:34:33 +0100 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (envelope-from ) id 1szaOG-0007ir-F5; Sat, 12 Oct 2024 12:34:32 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ecrips.co.uk; h=from:subject:mime-version:to:cc:content-transfer-encoding: content-type:cc:content-type:from:subject:to; s=s1; bh=HllTixWHcRgtvvTyqpKO3GQ2E0F3TP/9kcum1KNpdZY=; b=iyUUlW6WFxkkXHCX3swO+5JoANzLvUJqLpyLgk+YY/PmK9WstznLxLlCx/QUWOmXCk9M CbU7vT2a/c0Jphz43DknSp8UWtFLKFfj0UdhBw+lT1zo0xc33Fg2YjGPHycbRdPGjNoiWK D+NbcnYBdcEOLKXsfRwDekuvaTXqylkb/ptX6Gv86qt4SvDiUWOac0LokPamZHJOunXoSU E2hsjCyMpaSuvdT4fFH/H4TqtP2rEvQ6+1eYUgsuaUrCxS7R93wCUT62EEI3kBBVCR7nXb DJvD/pUlL0H/8WVksFlkVe9sXwU7jhQeADND20hnWuyyq1VwRQ4P7HSb7G7fOFhg== From: Steven Price Date: Sat, 12 Oct 2024 11:34:34 +0000 (UTC) Message-Id: <20241012113426.29641-1-steven@ecrips.co.uk> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?u001=2EbW9l0BBhaJRjHcuIgIwpN0SQNKxQxRu1fCE3Jw6oiernU4WLwiLJDSMiJ?= =?us-ascii?Q?+Exba+TRdQBIpc5UA7tT+HLmmAC3IX=2FkEfBVLF1?= =?us-ascii?Q?L51IvvZG9HKJLYrqa6AXTiOG1J6qvZgXqG1HIKv?= =?us-ascii?Q?=2FtfW6CZGl8C1C2FFF0PJKWJxOblCjwwqKHr8Jil?= =?us-ascii?Q?dHJ4n1163xYa7YCoTTxgmdkREDfVl4unucKbQcu?= =?us-ascii?Q?XaDAL7qE9MPQaSWuaTrQKC8nkVSLnxLLkwK6SU3?= =?us-ascii?Q?voU2?= To: seabios@seabios.org X-Entity-ID: u001.gyT0ofYxedQ1G6idyV8KSA== Message-ID-Hash: TZMAED7ONT4EARDBL7M3QQPUUZHAKRQT X-Message-ID-Hash: TZMAED7ONT4EARDBL7M3QQPUUZHAKRQT X-MailFrom: bounces+13645750-a181-seabios=seabios.org@em6131.ecrips.co.uk X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Steven Price X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [PATCH] vgabios: Fix generating modes list for static_functionality List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: / X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1728732901857116600 Content-Type: text/plain; charset="utf-8" Accessing the data in the vga_modes array requires using GET_GLOBAL(), and the bits set in the bit array should correspond to the modes, not the indexes in vga_modes. With this change the modes calculated matches the expected value of 0xfe0ff. Fixes: 12900b1a2431 ("vgabios: Fill in available legacy modes in video_func= _static at runtime") Signed-off-by: Steven Price --- I suspect this is also the cause of a bug reported against QEMU: https://gitlab.com/qemu-project/qemu/-/issues/629 --- vgasrc/stdvgamodes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vgasrc/stdvgamodes.c b/vgasrc/stdvgamodes.c index b1d0ef674db4..d72d36b4a27d 100644 --- a/vgasrc/stdvgamodes.c +++ b/vgasrc/stdvgamodes.c @@ -419,9 +419,9 @@ stdvga_build_video_param(void) // Fill available legacy modes in video_func_static table u32 modes =3D 0; for (i =3D 0; i < ARRAY_SIZE(vga_modes); i++) { - u16 mode =3D vga_modes[i].mode; + u16 mode =3D GET_GLOBAL(vga_modes[i].mode); if (mode <=3D 0x13) - modes |=3D 1<