skulls icon indicating copy to clipboard operation
skulls copied to clipboard

GRUB framebuffer not using whole screen with libgfxinit

Open paulmenzel opened this issue 6 years ago • 7 comments

There are reports, that the GRUB framebuffer screen is not using the whole screen (just a fourth or so). Information is missing, if it’s only happening with SeaBIOS as payload and SeaVGABIOS or also GRUB used as a payload.

paulmenzel avatar Feb 03 '19 23:02 paulmenzel

As document in the how-to from Chuck Nemeth changing the GRUB (in MBR) configuration like below, should do the trick.

[user@mainpc:~]$ sudoedit /etc/default/grub

# Uncomment and edit the following line to read:
GRUB_GFXMODE=1366x768x32

[user@mainpc:~]$ sudo update-grub

paulmenzel avatar Feb 03 '19 23:02 paulmenzel

thanks for looking that up paul, that indeed works. we'll have to document this.

so grub's vbeinfo knows about this mode. why doesn't it use it by default?

merge avatar Feb 04 '19 21:02 merge

On 04.02.19 22:04, Martin Kepplinger wrote:

thanks for looking that up paul, that indeed works. we'll have to document this.

Thank you for testing this so quickly.

so grub's vbeinfo knows about this mode. why doesn't it use it by default Good question. Unfortunately, I do not know. Do you have the full output?

What GRUB version is in your MBR?

paulmenzel avatar Feb 04 '19 21:02 paulmenzel

I didn't save the full output. Would that help? GRUB sees 640x480 which was used by default (in 2 color depth modes I think), and the mentioned correct screen resolution.

I use debian stable's version 2.02~beta3-5+deb9u1

merge avatar Feb 04 '19 21:02 merge

On 04.02.19 22:37, Martin Kepplinger wrote:

[…]

I use debian stable's version 2.02~beta3-5+deb9u1

It’d be great, if you tested this with the latest version from the master branch (or some Fedora or Ubuntu live system for example, as they have several GRUB patches applied too).

paulmenzel avatar Feb 04 '19 22:02 paulmenzel

From grub-core/term/gfxterm.c:

static grub_err_t
grub_gfxterm_term_init (struct grub_term_output *term __attribute__ ((unused)))
{
  char *tmp;
  grub_err_t err;
  const char *modevar;

  /* Parse gfxmode environment variable if set.  */
  modevar = grub_env_get ("gfxmode");
  if (! modevar || *modevar == 0)
    err = grub_video_set_mode (DEFAULT_VIDEO_MODE,
                               GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0);
  else
    {
      tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar);
      if (!tmp)
        return grub_errno;
      err = grub_video_set_mode (tmp, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0);
      grub_free (tmp);
    }

  if (err)
    return err;

  err = grub_gfxterm_fullscreen ();
  if (err)
    grub_video_restore ();

  return err;
}

DEFAULT_VIDEO_MODE seems to be set to auto by default.

grub_video_set_mode() from grub-core/video/video.c then seems to be called. I haven’t looked more into it, but it could be that the first working mode is just chosen.

paulmenzel avatar Feb 05 '19 11:02 paulmenzel

It's not just grub; this also happens if you add tint as a payload. Also, memtest (the coreboot payload) doesn't display anything with libgfxinit for me. (I'm not using skulls, but I doubt if there is any difference)

pgera avatar Sep 16 '19 06:09 pgera