mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-20 22:48:22 +00:00
2009-08-04 Robert Millan <rmh.grub@aybabtu.com>
Fix a bug resulting in black screen when loading Linux using a
packed video mode.
* kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette_width): New
function.
* include/grub/i386/pc/vbe.h (GRUB_VBE_CAPABILITY_DACWIDTH): New macro.
(grub_vbe_bios_getset_dac_palette_width): New function.
(grub_vbe_bios_get_dac_palette_width)
(grub_vbe_bios_set_dac_palette_width): New macros (act as wrappers for
grub_vbe_bios_getset_dac_palette_width()).
* video/i386/pc/vbe.c (grub_vbe_probe): Use `GRUB_VBE_STATUS_OK' to
check for return status.
(grub_vbe_get_video_mode_info): When getting information for a packed
mode (<= 8 bpp), obtain DAC palette width using
grub_vbe_bios_getset_dac_palette_width(), and use that for initializing
{red,green,blue}_mark_size.
This commit is contained in:
1 parent
ecb1a6d9e9
commit
f56a875639
4 files changed
+93
-1
No files matched your search
+19
-1
@@ -116,7 +116,7 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block)
|
||||
|
||||
/* Try to get controller info block. */
|
||||
status = grub_vbe_bios_get_controller_info (vbe_ib);
|
||||
if (status == 0x004F)
|
||||
if (status == GRUB_VBE_STATUS_OK)
|
||||
{
|
||||
/* Copy it for later usage. */
|
||||
grub_memcpy (&controller_info, vbe_ib, sizeof (controller_info));
|
||||
@@ -300,6 +300,24 @@ grub_vbe_get_video_mode_info (grub_uint32_t mode,
|
||||
|
||||
/* Make copy of mode info block. */
|
||||
grub_memcpy (mode_info, mi_tmp, sizeof (*mode_info));
|
||||
|
||||
/* Packed mode. Query DAC Palette width for color sizes. */
|
||||
if (mode_info->bits_per_pixel <= 8)
|
||||
{
|
||||
int width = 8;
|
||||
status = 0;
|
||||
|
||||
if (controller_info.capabilities & GRUB_VBE_CAPABILITY_DACWIDTH)
|
||||
status = grub_vbe_bios_set_dac_palette_width (& width);
|
||||
|
||||
if (status != GRUB_VBE_STATUS_OK)
|
||||
/* 6 is default after mode reset. */
|
||||
width = 6;
|
||||
|
||||
mode_info->red_mask_size = mode_info->green_mask_size
|
||||
= mode_info->blue_mask_size = width;
|
||||
mode_info->rsvd_mask_size = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Just clear mode info block if it isn't a VESA mode. */
|
||||
|
||||
Reference in new issue
Block a user