[1839] 2008-08-31 Colin D Bennett <[email protected]>

Vesa Jääskeläinen <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1839
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1839
Author:   chaac
Date:     2008-08-31 09:28:36 +0000 (Sun, 31 Aug 2008)

Log Message:
-----------
2008-08-31  Colin D Bennett <[email protected]>

        * 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.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/commands/i386/pc/vbeinfo.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2008-08-31 02:19:17 UTC (rev 1838)
+++ trunk/grub2/ChangeLog	2008-08-31 09:28:36 UTC (rev 1839)
@@ -1,3 +1,9 @@
+2008-08-31  Colin D Bennett <[email protected]>
+
+	* 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.
+
 2008-08-30  Pavel Roskin  <[email protected]>
 
 	* util/genmoddep.c: Remove for real this time.

Modified: trunk/grub2/commands/i386/pc/vbeinfo.c
===================================================================
--- trunk/grub2/commands/i386/pc/vbeinfo.c	2008-08-31 02:19:17 UTC (rev 1838)
+++ trunk/grub2/commands/i386/pc/vbeinfo.c	2008-08-31 09:28:36 UTC (rev 1839)
@@ -48,12 +48,18 @@
   grub_err_t err;
   char *modevar;
 
-  grub_printf ("List of compatible video modes:\n");
-
   err = grub_vbe_probe (&controller_info);
   if (err != GRUB_ERR_NONE)
     return err;
 
+  grub_printf ("VBE info:   version: %d.%d  OEM software rev: %d.%d\n",
+               controller_info.version >> 8, 
+               controller_info.version & 0xFF,
+               controller_info.oem_software_rev >> 8,
+               controller_info.oem_software_rev & 0xFF);
+  grub_printf ("            total memory: %d KiB\n",
+               (controller_info.total_memory << 16) / 1024);
+
   /* Because the information on video modes is stored in a temporary place,
      it is better to copy it to somewhere safe.  */
   p = video_mode_list = real2pm (controller_info.video_mode_ptr);
@@ -67,6 +73,10 @@
 
   grub_memcpy (saved_video_mode_list, video_mode_list, video_mode_list_size);
   
+  grub_printf ("List of compatible video modes:\n");
+  grub_printf ("Legend: P=Packed pixel, D=Direct color, "
+               "mask/pos=R/G/B/reserved\n"); 
+
   /* Walk through all video modes listed.  */
   for (p = saved_video_mode_list; *p != 0xFFFF; p++)
     {
@@ -103,10 +113,10 @@
       switch (mode_info_tmp.memory_model)
 	{
 	case 0x04:
-	  memory_model = "Packed Pixel";
+	  memory_model = "Packed";
 	  break;
 	case 0x06:
-	  memory_model = "Direct Color";
+	  memory_model = "Direct";
 	  break;
 
 	default:
@@ -116,12 +126,25 @@
       if (! memory_model)
 	continue;
 
-      grub_printf ("0x%03x: %d x %d x %d bpp (%s)\n",
-		   mode,
+      grub_printf ("0x%03x:  %4d x %4d x %2d  %s", 
+                   mode,
                    mode_info_tmp.x_resolution,
                    mode_info_tmp.y_resolution,
                    mode_info_tmp.bits_per_pixel,
-		   memory_model);
+                   memory_model);
+
+      /* Show mask and position details for direct color modes.  */
+      if (mode_info_tmp.memory_model == 0x06)
+        grub_printf (", mask: %d/%d/%d/%d  pos: %d/%d/%d/%d",
+                     mode_info_tmp.red_mask_size,
+                     mode_info_tmp.green_mask_size,
+                     mode_info_tmp.blue_mask_size,
+                     mode_info_tmp.rsvd_mask_size,
+                     mode_info_tmp.red_field_position,
+                     mode_info_tmp.green_field_position,
+                     mode_info_tmp.blue_field_position,
+                     mode_info_tmp.rsvd_field_position);
+      grub_printf ("\n");
     }
 
   grub_free (saved_video_mode_list);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.