All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: grub2 vga problem with [revno: 3054]
Date: Sat, 29 Jan 2011 01:22:03 +0300	[thread overview]
Message-ID: <4D43418B.1040102@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1101282233550.2966@boston.corp.fedex.com>

[-- Attachment #1: Type: text/plain, Size: 4306 bytes --]

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 <phcoder@gmail.com>
> 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
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>


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



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

  reply	other threads:[~2011-01-28 22:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28 14:35 grub2 vga problem with [revno: 3054] Jeff Chua
2011-01-28 22:22 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2011-01-29  2:30   ` Jeff Chua
2011-04-02 14:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-04-03 17:45   ` Jeff Chua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D43418B.1040102@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.