All of lore.kernel.org
 help / color / mirror / Atom feed
* grub2 vga problem with [revno: 3054]
@ 2011-01-28 14:35 Jeff Chua
  2011-01-28 22:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2011-04-02 14:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 5+ messages in thread
From: Jeff Chua @ 2011-01-28 14:35 UTC (permalink / raw)
  To: Grub Devel


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.


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];



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: grub2 vga problem with [revno: 3054]
  2011-01-28 14:35 grub2 vga problem with [revno: 3054] Jeff Chua
@ 2011-01-28 22:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2011-01-29  2:30   ` Jeff Chua
  2011-04-02 14:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 1 reply; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-01-28 22:22 UTC (permalink / raw)
  To: grub-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: grub2 vga problem with [revno: 3054]
  2011-01-28 22:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-01-29  2:30   ` Jeff Chua
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Chua @ 2011-01-29  2:30 UTC (permalink / raw)
  To: The development of GNU GRUB

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

2011/1/29 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>

> 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
>

Here's my grub.cfg ...

set default=0
set gfxmode="1024x768x32,800x600x32,640x480x32,1024x768,800x600"
set timeout=0
set gfxpayload=keep
set gfxpayloadforcelfb=y

insmod vbe
insmod gfxterm
insmod font
insmod jpeg

loadfont /grub/ascii.pf2
terminal_output gfxterm
background_image /grub/img.jpg


Tried. It seems it switch to console mode after showing the splash screen,
and the fonts are not linux native fonts as when it is set to
"terminal_output console". I can boot up to X, but switching to the console
would hang the screen or hang when X terminates.

If I remove the "set gfxpayload=keep", the boot up will be ok. It'll switch
to console mode after displaying the splash screen. But, I would like the
previous behavior of hiding the console using "set gfxpayload=keep".

Thanks,
Jeff

[-- Attachment #2: Type: text/html, Size: 1579 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: grub2 vga problem with [revno: 3054]
  2011-01-28 14:35 grub2 vga problem with [revno: 3054] Jeff Chua
  2011-01-28 22:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-04-02 14:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2011-04-03 17:45   ` Jeff Chua
  1 sibling, 1 reply; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-04-02 14:40 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Jeff Chua

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

On 28.01.2011 15:35, 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.
>
Colin Watson found a possible explanation and comitted the fix. Could
you retest? (with gfxpayloadforcelfb=y)

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



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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: grub2 vga problem with [revno: 3054]
  2011-04-02 14:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-04-03 17:45   ` Jeff Chua
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Chua @ 2011-04-03 17:45 UTC (permalink / raw)
  To: Vladimir 'φ-coder/phcoder' Serbinenko
  Cc: The development of GNU GRUB

2011/4/2 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
> On 28.01.2011 15:35, 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.
>>
> Colin Watson found a possible explanation and comitted the fix. Could
> you retest? (with gfxpayloadforcelfb=y)

Vladimir,

Yes, that worked only with gfxpayloadforcelfb=y.

Thanks,
Jeff.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-03 17:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-28 14:35 grub2 vga problem with [revno: 3054] Jeff Chua
2011-01-28 22:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-01-29  2:30   ` Jeff Chua
2011-04-02 14:40 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-04-03 17:45   ` Jeff Chua

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.