From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ka2DQ-00047h-TH for mharc-grub-devel@gnu.org; Mon, 01 Sep 2008 01:44:40 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ka2DP-00046T-51 for grub-devel@gnu.org; Mon, 01 Sep 2008 01:44:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ka2DO-00045J-6g for grub-devel@gnu.org; Mon, 01 Sep 2008 01:44:38 -0400 Received: from [199.232.76.173] (port=48989 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ka2DN-000458-WF for grub-devel@gnu.org; Mon, 01 Sep 2008 01:44:38 -0400 Received: from gateway04.websitewelcome.com ([67.18.124.7]:49215) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Ka2DN-0006GM-KN for grub-devel@gnu.org; Mon, 01 Sep 2008 01:44:38 -0400 Received: (qmail 10988 invoked from network); 1 Sep 2008 05:54:02 -0000 Received: from gator297.hostgator.com (74.53.228.114) by gateway04.websitewelcome.com with SMTP; 1 Sep 2008 05:54:02 -0000 Received: from c-67-185-142-228.hsd1.wa.comcast.net ([67.185.142.228]:45649 helo=gamma.lan) by gator297.hostgator.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1Ka2DH-0006cn-7F; Mon, 01 Sep 2008 00:44:31 -0500 Date: Sun, 31 Aug 2008 22:44:28 -0700 From: Colin D Bennett To: grub-devel@gnu.org, Vesa =?UTF-8?Q?J=C3=A4=C3=A4skel=C3=A4inen?= Message-ID: <20080831224428.09e19d1b@gamma.lan> In-Reply-To: <20080831093723.3c11b80d@gamma.lan> References: <20080830235952.4c686b44@gamma.lan> <48BA64B0.7070605@nic.fi> <20080831064323.1531de53@gamma.lan> <48BABFF9.4000904@nic.fi> <20080831093723.3c11b80d@gamma.lan> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/KzV=ech/ETX8wAm.uTS9VcD"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator297.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gibibit.com X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Cc: Subject: Re: [PATCH] GSoC #08 [v3] vbeinfo enhancements X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 05:44:39 -0000 --Sig_/KzV=ech/ETX8wAm.uTS9VcD Content-Type: multipart/mixed; boundary="MP_/M.EjjVewv4z8I__vfftrpjA" --MP_/M.EjjVewv4z8I__vfftrpjA Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This refinement is against current SVN head. It introduces the VBE mode info field constant values into vbe.h and these are used instead of the magic numbers in vbeinfo.c. Regards, Colin --MP_/M.EjjVewv4z8I__vfftrpjA Content-Type: text/plain; name=08_ChangeLog.txt Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=08_ChangeLog.txt 2008-08-31 Colin D Bennett * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Show VBE version and total video memory in 'vbeinfo' output; show color format details for each video mode. Added constant values for VBE mode info values, and replaced magic numbers with references to constants. * include/grub/i386/pc/vbe.h: Created VBE mode info field value constant macros. --MP_/M.EjjVewv4z8I__vfftrpjA Content-Type: text/x-patch; name=08_vbeinfo-enhancements.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=08_vbeinfo-enhancements.patch =3D=3D=3D modified file 'commands/i386/pc/vbeinfo.c' --- commands/i386/pc/vbeinfo.c 2008-08-31 08:28:36 +0000 +++ commands/i386/pc/vbeinfo.c 2008-09-01 05:36:39 +0000 @@ -57,6 +57,7 @@ controller_info.version & 0xFF, controller_info.oem_software_rev >> 8, controller_info.oem_software_rev & 0xFF); + /* The total_memory field is in 64 KiB units. */ grub_printf (" total memory: %d KiB\n", (controller_info.total_memory << 16) / 1024); =20 @@ -90,32 +91,32 @@ continue; } =20 - if ((mode_info_tmp.mode_attributes & 0x001) =3D=3D 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_SUPPORTED) = =3D=3D 0) /* If not available, skip it. */ continue; =20 - if ((mode_info_tmp.mode_attributes & 0x002) =3D=3D 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_RESERVED_1) = =3D=3D 0) /* Not enough information. */ continue; =20 - if ((mode_info_tmp.mode_attributes & 0x008) =3D=3D 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_COLOR) =3D=3D= 0) /* Monochrome is unusable. */ continue; =20 - if ((mode_info_tmp.mode_attributes & 0x080) =3D=3D 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_LFB_AVAIL) = =3D=3D 0) /* We support only linear frame buffer modes. */ continue; =20 - if ((mode_info_tmp.mode_attributes & 0x010) =3D=3D 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_GRAPHICS) =3D= =3D 0) /* We allow only graphical modes. */ continue; =20 switch (mode_info_tmp.memory_model) { - case 0x04: + case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL: memory_model =3D "Packed"; break; - case 0x06: + case GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR: memory_model =3D "Direct"; break; =20 @@ -134,7 +135,7 @@ memory_model); =20 /* Show mask and position details for direct color modes. */ - if (mode_info_tmp.memory_model =3D=3D 0x06) + if (mode_info_tmp.memory_model =3D=3D GRUB_VBE_MEMORY_MODEL_DIRECT_C= OLOR) grub_printf (", mask: %d/%d/%d/%d pos: %d/%d/%d/%d", mode_info_tmp.red_mask_size, mode_info_tmp.green_mask_size, =3D=3D=3D modified file 'include/grub/i386/pc/vbe.h' --- include/grub/i386/pc/vbe.h 2008-01-01 12:02:07 +0000 +++ include/grub/i386/pc/vbe.h 2008-09-01 05:34:40 +0000 @@ -30,9 +30,30 @@ /* VBE status codes. */ #define GRUB_VBE_STATUS_OK 0x004f =20 -/* VBE memory model types. */ -#define GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL 0x04 -#define GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR 0x06 +/* Bits from the GRUB_VBE "mode_attributes" field in the mode info struct.= */ +#define GRUB_VBE_MODEATTR_SUPPORTED (1 << 0) +#define GRUB_VBE_MODEATTR_RESERVED_1 (1 << 1) +#define GRUB_VBE_MODEATTR_BIOS_TTY_OUTPUT_SUPPORT (1 << 2) +#define GRUB_VBE_MODEATTR_COLOR (1 << 3) +#define GRUB_VBE_MODEATTR_GRAPHICS (1 << 4) +#define GRUB_VBE_MODEATTR_VGA_COMPATIBLE (1 << 5) +#define GRUB_VBE_MODEATTR_VGA_WINDOWED_AVAIL (1 << 6) +#define GRUB_VBE_MODEATTR_LFB_AVAIL (1 << 7) +#define GRUB_VBE_MODEATTR_DOUBLE_SCAN_AVAIL (1 << 8) +#define GRUB_VBE_MODEATTR_INTERLACED_AVAIL (1 << 9) +#define GRUB_VBE_MODEATTR_TRIPLE_BUF_AVAIL (1 << 10) +#define GRUB_VBE_MODEATTR_STEREO_AVAIL (1 << 11) +#define GRUB_VBE_MODEATTR_DUAL_DISPLAY_START (1 << 12) + +/* Values for the GRUB_VBE memory_model field in the mode info struct. */ +#define GRUB_VBE_MEMORY_MODEL_TEXT 0x00 +#define GRUB_VBE_MEMORY_MODEL_CGA 0x01 +#define GRUB_VBE_MEMORY_MODEL_HERCULES 0x02 +#define GRUB_VBE_MEMORY_MODEL_PLANAR 0x03 +#define GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL 0x04 +#define GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256 0x05 +#define GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR 0x06 +#define GRUB_VBE_MEMORY_MODEL_YUV 0x07 =20 /* Note: =20 --MP_/M.EjjVewv4z8I__vfftrpjA-- --Sig_/KzV=ech/ETX8wAm.uTS9VcD Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAki7gUAACgkQokx8fzcGbYc6EQCeJGIhf5JOnOJy3fyCOjzA72Yf Et4AoIGI+0bRnFqjiEnv6W6Odn9ekRvS =tPlw -----END PGP SIGNATURE----- --Sig_/KzV=ech/ETX8wAm.uTS9VcD--