Preferred resolution detection for VBE.
authorColin Watson <cjwatson@ubuntu.com>
Thu, 21 Jul 2011 18:46:44 +0000 (19:46 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Thu, 21 Jul 2011 18:46:44 +0000 (19:46 +0100)
commit8fc4fa45c5dedfaf8fcfde9538b482650abeee5e
treeff0afe42ebe440133125151fca0e221b431c9bc5
parentca5572a9ad872fd26712d0fbae1ab63adc64787b
parente806ce60eeac7ef2303e47aebae4e744bdc505cc
Preferred resolution detection for VBE.

* grub-core/video/video.c (grub_video_edid_checksum): New function.
(grub_video_edid_preferred_mode): Likewise.  Try EDID followed by
the Flat Panel extension, in line with the X.org VESA driver.
* grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_flat_panel_info):
New function.
(grub_vbe_bios_get_ddc_capabilities): Likewise.
(grub_vbe_bios_read_edid): Likewise.
(grub_vbe_get_preferred_mode): Likewise.
(grub_video_vbe_setup): When the mode is "auto", try to get the
preferred mode from VBE, and use the largest mode that is no larger
than the preferred mode (some BIOSes expose a preferred mode that is
not in their mode list!).  If this fails, fall back to 640x480 as a
safe conservative choice.
(grub_video_vbe_get_edid): New function.
(grub_video_vbe_adapter): Add get_edid.
* include/grub/video.h (struct grub_vbe_edid_info): New structure.
(struct grub_video_adapter): Add get_edid.
(grub_video_edid_checksum): Add prototype.
(grub_video_edid_preferred_mode): Likewise.
* include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New
structure.

* grub-core/commands/videoinfo.c (print_edid): New function.
(grub_cmd_videoinfo): Print EDID if available.

* util/grub.d/00_header.in (GRUB_GFXMODE): Default to "auto".  This
is more appropriate on a wider range of platforms than 640x480.
* docs/grub.texi (Simple configuration): Update GRUB_GFXMODE
documentation.
ChangeLog
docs/grub.texi
grub-core/commands/videoinfo.c
grub-core/video/i386/pc/vbe.c
util/grub.d/00_header.in