From nobody Fri Mar 29 14:24:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1564588303; cv=none; d=zoho.com; s=zohoarc; b=JBfR7b66cwXkKo0xnJod76Sqezlk1A7JkhIE7ASsE21Rc8rbx0gMlOZO/kayOHUEOx1gVzO7q2WoIYgcJOL73nsvy7yV1f3+V6PsZm89gFW4Zz7/9h1Nt1xzNPtIS+0qR3R0Lnzzdf9uKqBerY4nF8BOX0pdZPE7/CgxO4QTyC4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564588303; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=ITvnvA6wYxVhqxVFNGr+WtkNfEFf9NpMvE6CHtlLCNc=; b=TQuWa/JLf2MyylR2RhojhDUSb5XlsoWWW4Ag1gz0opcdMgbsL2MHAyK9r2Rek2J0fo/fOHobGidmW3Cn0Llyb+CqK43PLrfkHsfsJprTVEG3e47mzxfrX1hlYBiMfIjzTp33xS0/tJJHClgI2tcykJvU1dQLWFxsQ7iR442J1d8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) 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 1564588303797244.38901372907628; Wed, 31 Jul 2019 08:51:43 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id 676AD601813; Wed, 31 Jul 2019 15:51:39 +0000 (UTC) Received: from antares.kleine-koenig.org (antares.kleine-koenig.org [94.130.110.236]) by coreboot.org (Postfix) with ESMTP id 582BD6017F7 for ; Wed, 31 Jul 2019 15:51:25 +0000 (UTC) Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id 2FA81747231; Wed, 31 Jul 2019 17:51:25 +0200 (CEST) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Gerd Hoffmann , Kevin O'Connor Date: Wed, 31 Jul 2019 17:51:14 +0200 Message-Id: <20190731155115.16571-2-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190731155115.16571-1-uwe@kleine-koenig.org> References: <20190731155115.16571-1-uwe@kleine-koenig.org> MIME-Version: 1.0 X-Spam: Yes Message-ID-Hash: 7PSFPXFQLAYDBXNNIMBLMQIA5DH2J6F4 X-Message-ID-Hash: 7PSFPXFQLAYDBXNNIMBLMQIA5DH2J6F4 X-MailFrom: uwe@kleine-koenig.org 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; suspicious-header CC: seabios@seabios.org X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v3 1/2] cbvga: reuse svga modes definitions from svgamodes.c List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++++ X-Spam-Level: ***** Authentication-Results: coreboot.org Content-Type: text/plain; charset="utf-8" For cbvga only modes with MM_DIRECT are usable, so skip the other ones. This effectively adds the following modes: { 0x10D, { MM_DIRECT, 320, 200, 15, 8, 16, SEG_GRAPH } }, { 0x10E, { MM_DIRECT, 320, 200, 16, 8, 16, SEG_GRAPH } }, { 0x10F, { MM_DIRECT, 320, 200, 24, 8, 16, SEG_GRAPH } }, { 0x140, { MM_DIRECT, 320, 200, 32, 8, 16, SEG_GRAPH } }, --- vgasrc/cbvga.c | 80 ++++++-------------------------------------------- 1 file changed, 9 insertions(+), 71 deletions(-) diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c index 438d8fda6c6e..b919137bb183 100644 --- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -13,76 +13,13 @@ #include "vgabios.h" // SET_VGA #include "vgafb.h" // handle_gfx_op #include "vgautil.h" // VBE_total_memory +#include "svgamodes.h" // svga_modes =20 static int CBmode VAR16; static struct vgamode_s CBmodeinfo VAR16; static struct vgamode_s CBemulinfo VAR16; static u32 CBlinelength VAR16; =20 -static struct cbvga_mode_s -{ - u16 mode; - struct vgamode_s info; -} cbvesa_modes[] VAR16 =3D { - /* VESA 1.0 modes */ - { 0x110, { MM_DIRECT, 640, 480, 15, 8, 16, SEG_GRAPH } }, - { 0x111, { MM_DIRECT, 640, 480, 16, 8, 16, SEG_GRAPH } }, - { 0x112, { MM_DIRECT, 640, 480, 24, 8, 16, SEG_GRAPH } }, - { 0x113, { MM_DIRECT, 800, 600, 15, 8, 16, SEG_GRAPH } }, - { 0x114, { MM_DIRECT, 800, 600, 16, 8, 16, SEG_GRAPH } }, - { 0x115, { MM_DIRECT, 800, 600, 24, 8, 16, SEG_GRAPH } }, - { 0x116, { MM_DIRECT, 1024, 768, 15, 8, 16, SEG_GRAPH } }, - { 0x117, { MM_DIRECT, 1024, 768, 16, 8, 16, SEG_GRAPH } }, - { 0x118, { MM_DIRECT, 1024, 768, 24, 8, 16, SEG_GRAPH } }, - { 0x119, { MM_DIRECT, 1280, 1024, 15, 8, 16, SEG_GRAPH } }, - { 0x11A, { MM_DIRECT, 1280, 1024, 16, 8, 16, SEG_GRAPH } }, - { 0x11B, { MM_DIRECT, 1280, 1024, 24, 8, 16, SEG_GRAPH } }, - { 0x11D, { MM_DIRECT, 1600, 1200, 15, 8, 16, SEG_GRAPH } }, - { 0x11E, { MM_DIRECT, 1600, 1200, 16, 8, 16, SEG_GRAPH } }, - { 0x11F, { MM_DIRECT, 1600, 1200, 24, 8, 16, SEG_GRAPH } }, - /* VESA 2.0 modes */ - { 0x141, { MM_DIRECT, 640, 400, 32, 8, 16, SEG_GRAPH } }, - { 0x142, { MM_DIRECT, 640, 480, 32, 8, 16, SEG_GRAPH } }, - { 0x143, { MM_DIRECT, 800, 600, 32, 8, 16, SEG_GRAPH } }, - { 0x144, { MM_DIRECT, 1024, 768, 32, 8, 16, SEG_GRAPH } }, - { 0x145, { MM_DIRECT, 1280, 1024, 32, 8, 16, SEG_GRAPH } }, - { 0x147, { MM_DIRECT, 1600, 1200, 32, 8, 16, SEG_GRAPH } }, - { 0x149, { MM_DIRECT, 1152, 864, 15, 8, 16, SEG_GRAPH } }, - { 0x14a, { MM_DIRECT, 1152, 864, 16, 8, 16, SEG_GRAPH } }, - { 0x14b, { MM_DIRECT, 1152, 864, 24, 8, 16, SEG_GRAPH } }, - { 0x14c, { MM_DIRECT, 1152, 864, 32, 8, 16, SEG_GRAPH } }, - { 0x175, { MM_DIRECT, 1280, 768, 16, 8, 16, SEG_GRAPH } }, - { 0x176, { MM_DIRECT, 1280, 768, 24, 8, 16, SEG_GRAPH } }, - { 0x177, { MM_DIRECT, 1280, 768, 32, 8, 16, SEG_GRAPH } }, - { 0x178, { MM_DIRECT, 1280, 800, 16, 8, 16, SEG_GRAPH } }, - { 0x179, { MM_DIRECT, 1280, 800, 24, 8, 16, SEG_GRAPH } }, - { 0x17a, { MM_DIRECT, 1280, 800, 32, 8, 16, SEG_GRAPH } }, - { 0x17b, { MM_DIRECT, 1280, 960, 16, 8, 16, SEG_GRAPH } }, - { 0x17c, { MM_DIRECT, 1280, 960, 24, 8, 16, SEG_GRAPH } }, - { 0x17d, { MM_DIRECT, 1280, 960, 32, 8, 16, SEG_GRAPH } }, - { 0x17e, { MM_DIRECT, 1440, 900, 16, 8, 16, SEG_GRAPH } }, - { 0x17f, { MM_DIRECT, 1440, 900, 24, 8, 16, SEG_GRAPH } }, - { 0x180, { MM_DIRECT, 1440, 900, 32, 8, 16, SEG_GRAPH } }, - { 0x181, { MM_DIRECT, 1400, 1050, 16, 8, 16, SEG_GRAPH } }, - { 0x182, { MM_DIRECT, 1400, 1050, 24, 8, 16, SEG_GRAPH } }, - { 0x183, { MM_DIRECT, 1400, 1050, 32, 8, 16, SEG_GRAPH } }, - { 0x184, { MM_DIRECT, 1680, 1050, 16, 8, 16, SEG_GRAPH } }, - { 0x185, { MM_DIRECT, 1680, 1050, 24, 8, 16, SEG_GRAPH } }, - { 0x186, { MM_DIRECT, 1680, 1050, 32, 8, 16, SEG_GRAPH } }, - { 0x187, { MM_DIRECT, 1920, 1200, 16, 8, 16, SEG_GRAPH } }, - { 0x188, { MM_DIRECT, 1920, 1200, 24, 8, 16, SEG_GRAPH } }, - { 0x189, { MM_DIRECT, 1920, 1200, 32, 8, 16, SEG_GRAPH } }, - { 0x18a, { MM_DIRECT, 2560, 1600, 16, 8, 16, SEG_GRAPH } }, - { 0x18b, { MM_DIRECT, 2560, 1600, 24, 8, 16, SEG_GRAPH } }, - { 0x18c, { MM_DIRECT, 2560, 1600, 32, 8, 16, SEG_GRAPH } }, - { 0x18d, { MM_DIRECT, 1280, 720, 16, 8, 16, SEG_GRAPH } }, - { 0x18e, { MM_DIRECT, 1280, 720, 24, 8, 16, SEG_GRAPH } }, - { 0x18f, { MM_DIRECT, 1280, 720, 32, 8, 16, SEG_GRAPH } }, - { 0x190, { MM_DIRECT, 1920, 1080, 16, 8, 16, SEG_GRAPH } }, - { 0x191, { MM_DIRECT, 1920, 1080, 24, 8, 16, SEG_GRAPH } }, - { 0x192, { MM_DIRECT, 1920, 1080, 32, 8, 16, SEG_GRAPH } }, -}; - struct vgamode_s *cbvga_find_mode(int mode) { if (mode =3D=3D GET_GLOBAL(CBmode)) @@ -91,8 +28,8 @@ struct vgamode_s *cbvga_find_mode(int mode) return &CBemulinfo; =20 int i; - for (i =3D 0; i < ARRAY_SIZE(cbvesa_modes); i++) { - struct cbvga_mode_s *cbmode_g =3D &cbvesa_modes[i]; + for (i =3D 0; i < GET_GLOBAL(svga_mcount); i++) { + struct generic_svga_mode *cbmode_g =3D &svga_modes[i]; if (GET_GLOBAL(cbmode_g->mode) =3D=3D 0xffff) continue; if (GET_GLOBAL(cbmode_g->mode) =3D=3D mode) @@ -114,8 +51,8 @@ cbvga_list_modes(u16 seg, u16 *dest, u16 *last) * + 24 Bpp and 32 Bpp are supported */ int i; - for (i =3D 0; i < ARRAY_SIZE(cbvesa_modes) && dest < last; i++) { - struct cbvga_mode_s *cbmode_g =3D &cbvesa_modes[i]; + for (i =3D 0; i < GET_GLOBAL(svga_mcount) && dest < last; i++) { + struct generic_svga_mode *cbmode_g =3D &svga_modes[i]; u16 mode =3D GET_GLOBAL(cbmode_g->mode); if (mode =3D=3D 0xffff) continue; @@ -265,10 +202,11 @@ cbvga_setup_modes(u64 addr, u8 bpp, u32 xlines, u32 y= lines, u32 linelength) , get_global_seg(), &CBmodeinfo, sizeof(CBemulinfo)); =20 // Validate modes - for (i =3D 0; i < ARRAY_SIZE(cbvesa_modes); i++) { - struct cbvga_mode_s *cbmode_g =3D &cbvesa_modes[i]; + for (i =3D 0; i < GET_GLOBAL(svga_mcount); i++) { + struct generic_svga_mode *cbmode_g =3D &svga_modes[i]; /* Skip VBE modes that doesn't fit into coreboot's framebuffer */ - if ((GET_GLOBAL(cbmode_g->info.height) > ylines) + if ((GET_GLOBAL(cbmode_g->info.memmodel) !=3D MM_DIRECT) + || (GET_GLOBAL(cbmode_g->info.height) > ylines) || (GET_GLOBAL(cbmode_g->info.width) > xlines) || (GET_GLOBAL(cbmode_g->info.depth) !=3D bpp)) { dprintf(3, "Removing mode %x\n", GET_GLOBAL(cbmode_g->mode)); --=20 2.20.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Fri Mar 29 14:24:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1564588310; cv=none; d=zoho.com; s=zohoarc; b=decqHbWqT1EucLALfZhUrTJFmpa5Vwjme3z3Y1rSH4Xig5nfC52vsLVFyW9Afp4juSIGjtIAggJUTLN1sZ/XPPpOYqqulJvDLNU8A2hmnY0gh46ZrvAPstBoitRGuRLSdU5VMgye+vI20a009crHOYmYjJTocQsJDNTwcZkMAWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564588310; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=oxrAw7gku2owEQ8AzDAI6XC0/ILEDXEp8Jk61k0Zeyc=; b=iJQA1G9dDPNtd/CSeGVE3R95cOAWP5KfoqrO1HwNV6xqxYt2IJVfBnagtdlRzqBuDGlPDaqkg5tAk+9CdPj1yAM+ZO+c0sMr8nj5FCSiRoB6KUe+yDCEmMzmotjRQ4J0XlNqu228v+qP63b9f4mqx2qqPTef/wbYMcaUqSv9G6Y= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) 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 1564588310222933.2482064674734; Wed, 31 Jul 2019 08:51:50 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id 29030601819; Wed, 31 Jul 2019 15:51:46 +0000 (UTC) Received: from antares.kleine-koenig.org (antares.kleine-koenig.org [94.130.110.236]) by coreboot.org (Postfix) with ESMTP id 4673D6017F9 for ; Wed, 31 Jul 2019 15:51:27 +0000 (UTC) Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id 2462E747233; Wed, 31 Jul 2019 17:51:27 +0200 (CEST) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Gerd Hoffmann , Kevin O'Connor Date: Wed, 31 Jul 2019 17:51:15 +0200 Message-Id: <20190731155115.16571-3-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190731155115.16571-1-uwe@kleine-koenig.org> References: <20190731155115.16571-1-uwe@kleine-koenig.org> MIME-Version: 1.0 X-Spam: Yes Message-ID-Hash: 277OF3GVEOZVLKIJQEU3MLANYFDV7PS2 X-Message-ID-Hash: 277OF3GVEOZVLKIJQEU3MLANYFDV7PS2 X-MailFrom: uwe@kleine-koenig.org 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; suspicious-header CC: seabios@seabios.org X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v3 2/2] Add additional resolutions for 16:9 displays: 1600x900 and 2560x1440 List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++++ X-Spam-Level: ***** Authentication-Results: coreboot.org Content-Type: text/plain; charset="utf-8" This allows to have qemu run at the native screen resolution of my (physical) monitor. This is inspired by a patch created by Andreas Dangel that I found on https://adangel.org/2015/09/11/qemu-kvm-custom-resolutions/ . --- vgasrc/svgamodes.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vgasrc/svgamodes.c b/vgasrc/svgamodes.c index 013504c3e691..f89ebef950a8 100644 --- a/vgasrc/svgamodes.c +++ b/vgasrc/svgamodes.c @@ -76,5 +76,13 @@ struct generic_svga_mode svga_modes[] VAR16 =3D { { 0x190, { MM_DIRECT, 1920, 1080, 16, 8, 16, SEG_GRAPH } }, { 0x191, { MM_DIRECT, 1920, 1080, 24, 8, 16, SEG_GRAPH } }, { 0x192, { MM_DIRECT, 1920, 1080, 32, 8, 16, SEG_GRAPH } }, + + /* custom resolutions for 16:9 displays */ + { 0x193, { MM_DIRECT, 1600, 900, 16, 8, 16, SEG_GRAPH } }, + { 0x194, { MM_DIRECT, 1600, 900, 24, 8, 16, SEG_GRAPH } }, + { 0x195, { MM_DIRECT, 1600, 900, 32, 8, 16, SEG_GRAPH } }, + { 0x196, { MM_DIRECT, 2560, 1440, 16, 8, 16, SEG_GRAPH } }, + { 0x197, { MM_DIRECT, 2560, 1440, 24, 8, 16, SEG_GRAPH } }, + { 0x198, { MM_DIRECT, 2560, 1440, 32, 8, 16, SEG_GRAPH } }, }; unsigned int svga_mcount VAR16 =3D ARRAY_SIZE(svga_modes); --=20 2.20.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org