grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub2 vga problem with [revno: 3054]


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: grub2 vga problem with [revno: 3054]
Date: Sat, 29 Jan 2011 01:22:03 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Icedove/3.0.11

On 01/28/2011 05:35 PM, Jeff Chua wrote:
>
> It seems after revno: 3504 is applied, booting linux with
> terminal_output gfxterm and background_image caused the screen to
> hang. Reverting the patch solves the problem.
>
Have you tried
gfxpayloadforcelfb=y
?
>
> Thanks,
> Jeff
>
> ------------------------------------------------------------
> revno: 3054
> committer: Vladimir 'phcoder' Serbinenko <address@hidden>
> branch nick: grub
> timestamp: Tue 2011-01-11 00:02:01 +0100
> message:
>         Pass more appropriate video id to Linux.
>
>         * grub-core/loader/i386/linux.c (grub_linux_setup_video): Use
>         grub_video_get_driver_id and variable gfxpayloadforcelfb to
>         fill have_vga.
>         (grub_linux_boot): Rely on grub_linux_setup_video to fill
> have_vga and
>         shift params->lfb_size.
>         * include/grub/i386/linux.h: Make an enume out of have_vga
> values.
> ------------------------------------------------------------
>
>
> --- grub2/grub-core/loader/i386/linux.c    2011-01-11
> 08:59:20.000000000 +0800
> +++ grub2/grub-core/loader/i386/linux.c    2011-01-28
> 16:23:45.000000000 +0800
> @@ -310,6 +310,13 @@
>    struct grub_video_mode_info mode_info;
>    void *framebuffer;
>    grub_err_t err;
> +  grub_video_driver_id_t driver_id;
> +  char *gfxlfbvar = grub_env_get ("gfxpayloadforcelfb");
> +
> +  driver_id = grub_video_get_driver_id ();
> +
> +  if (driver_id == GRUB_VIDEO_DRIVER_NONE)
> +    return 1;
>
>    err = grub_video_get_info_and_fini (&mode_info, &framebuffer);
>
> @@ -336,12 +343,40 @@
>    params->reserved_mask_size = mode_info.reserved_mask_size;
>    params->reserved_field_pos = mode_info.reserved_field_pos;
>
> +  if (gfxlfbvar && (gfxlfbvar[0] == '1' || gfxlfbvar[0] == 'y'))
> +    params->have_vga = GRUB_VIDEO_LINUX_TYPE_SIMPLE;
> +  else
> +    {
> +      switch (driver_id)
> +    {
> +    case GRUB_VIDEO_DRIVER_VBE:
> +      params->lfb_size >>= 16;
> +      params->have_vga = GRUB_VIDEO_LINUX_TYPE_VESA;
> +      break;
> + +    case GRUB_VIDEO_DRIVER_EFI_UGA:
> +    case GRUB_VIDEO_DRIVER_EFI_GOP:
> +      params->have_vga = GRUB_VIDEO_LINUX_TYPE_EFIFB;
> +      break;
> +
> +      /* FIXME: check if better id is available.  */
> +    case GRUB_VIDEO_DRIVER_SM712:
> +    case GRUB_VIDEO_DRIVER_VGA:
> +    case GRUB_VIDEO_DRIVER_CIRRUS:
> +    case GRUB_VIDEO_DRIVER_BOCHS:
> +      /* Make gcc happy. */
> +    case GRUB_VIDEO_DRIVER_SDL:
> +    case GRUB_VIDEO_DRIVER_NONE:
> +      params->have_vga = GRUB_VIDEO_LINUX_TYPE_SIMPLE;
> +      break;
> +    }
> +    }
>
>  #ifdef GRUB_MACHINE_PCBIOS
>    /* VESA packed modes may come with zeroed mask sizes, which need
>       to be set here according to DAC Palette width.  If we don't,
>       this results in Linux displaying a black screen.  */
> -  if (mode_info.bpp <= 8)
> +  if (driver_id == GRUB_VIDEO_DRIVER_VBE && mode_info.bpp <= 8)
>      {
>        struct grub_vbe_info_block controller_info;
>        int status;
> @@ -454,15 +489,7 @@
>        grub_errno = GRUB_ERR_NONE;
>      }
>
> -  if (! grub_linux_setup_video (params))
> -    {
> -      /* Use generic framebuffer unless VESA is known to be
> supported.  */
> -      if (params->have_vga != GRUB_VIDEO_LINUX_TYPE_VESA)
> -    params->have_vga = GRUB_VIDEO_LINUX_TYPE_SIMPLE;
> -      else
> -    params->lfb_size >>= 16;
> -    }
> -  else
> +  if (grub_linux_setup_video (params))
>      {
>  #if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT)
> || defined (GRUB_MACHINE_QEMU)
>        params->have_vga = GRUB_VIDEO_LINUX_TYPE_TEXT;
> @@ -768,10 +795,6 @@
>          break;
>            }
>
> -        /* We can't detect VESA, but user is implicitly telling us
> that it
> -           is built-in because `vga=' parameter was used.  */
> -        params->have_vga = GRUB_VIDEO_LINUX_TYPE_VESA;
> -
>          linux_mode = &grub_vesa_mode_table[vid_mode
>                             - GRUB_VESA_MODE_TABLE_START];
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]