Show mode id

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-03 21:40:40 +02:00
parent 540e2fe185
commit 4787931fe0
3 changed files with 17 additions and 6 deletions

View file

@ -28,11 +28,15 @@
static int
hook (const struct grub_video_mode_info *info)
{
if (info->mode_number == GRUB_VIDEO_MODE_NUMBER_INVALID)
grub_printf (" ");
else
grub_printf (" 0x%03x ", info->mode_number);
grub_printf ("%4d x %4d x %2d ", info->height, info->width, info->bpp);
/* Show mask and position details for direct color modes. */
if (info->mode_type & GRUB_VIDEO_MODE_TYPE_RGB)
grub_printf ("D, mask: %d/%d/%d/%d pos: %d/%d/%d/%d",
grub_printf ("Direct, mask: %d/%d/%d/%d pos: %d/%d/%d/%d",
info->red_mask_size,
info->green_mask_size,
info->blue_mask_size,
@ -42,7 +46,7 @@ hook (const struct grub_video_mode_info *info)
info->blue_field_pos,
info->reserved_field_pos);
if (info->mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR)
grub_printf ("P");
grub_printf ("Packed");
grub_printf ("\n");
return 0;

View file

@ -547,9 +547,12 @@ doublebuf_pageflipping_set_page (int page)
}
static void
vbe2videoinfo (const struct grub_vbe_mode_info_block *vbeinfo,
vbe2videoinfo (grub_uint32_t mode,
const struct grub_vbe_mode_info_block *vbeinfo,
struct grub_video_mode_info *mode_info)
{
mode_info->mode_number = mode;
mode_info->width = vbeinfo->x_resolution;
mode_info->height = vbeinfo->y_resolution;
switch (vbeinfo->memory_model)
@ -619,7 +622,7 @@ grub_video_vbe_iterate (int (*hook) (const struct grub_video_mode_info *info))
break;
}
vbe2videoinfo (&vbe_mode_info, &mode_info);
vbe2videoinfo (*p, &vbe_mode_info, &mode_info);
if (hook (&mode_info))
return 1;
}
@ -735,7 +738,8 @@ grub_video_vbe_setup (unsigned int width, unsigned int height,
return grub_errno;
/* Fill mode info details. */
vbe2videoinfo (&active_vbe_mode_info, &framebuffer.mode_info);
vbe2videoinfo (best_vbe_mode, &active_vbe_mode_info,
&framebuffer.mode_info);
{
/* Get video RAM size in bytes. */

View file

@ -117,6 +117,9 @@ struct grub_video_mode_info
/* In index color mode, number of colors. In RGB mode this is 256. */
unsigned int number_of_colors;
unsigned int mode_number;
#define GRUB_VIDEO_MODE_NUMBER_INVALID 0xffffffff
/* Optimization hint how binary data is coded. */
enum grub_video_blit_format blit_format;