Comment 6 for bug 907446

Revision history for this message
TJ (tj) wrote :

I've been analysing the kernel's start-up code that sets the console.

The selection of the dummy console occurs in drivers/video/console/vgacon.c::vgacon_startup()

There is a code label "novga" which results in the VGA console driver not being used:

 if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB ||
     screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) {
       no_vga:
#ifdef CONFIG_DUMMY_CONSOLE
  conswitchp = &dummy_con;
  return conswitchp->con_startup();
#else
  return NULL;
#endif

The "novga" label is also reached from later code that checks boot_params.screen_info has been initialized, and then whether the screen is in a VGA16 mode not handled by VGACON.

 /* boot_params.screen_info initialized? */
 if ((screen_info.orig_video_mode == 0) &&
     (screen_info.orig_video_lines == 0) &&
     (screen_info.orig_video_cols == 0))
  goto no_vga;

 /* VGA16 modes are not handled by VGACON */
 if ((screen_info.orig_video_mode == 0x0D) || /* 320x200/4 */
     (screen_info.orig_video_mode == 0x0E) || /* 640x200/4 */
     (screen_info.orig_video_mode == 0x10) || /* 640x350/4 */
     (screen_info.orig_video_mode == 0x12) || /* 640x480/4 */
     (screen_info.orig_video_mode == 0x6A)) /* 800x600/4 (VESA) */
  goto no_vga;

For a while I was chasing a presumption that arch/x86/kernel/setup.c::setup_arch() was enabling EFI support with

efi_enabled=1;

After a lot of analysis of boot_params.efi_info I arrived at the "novga" code and realised it can also be triggered by the boot-loader leaving the display in a graphic mode.

I then investigated the GRUB configuration and discovered the GRUB_GFXPAYLOAD_LINUX option, described in the blueprint

https://blueprints.launchpad.net/ubuntu/+spec/packageselection-foundations-n-grub2-boot-framebuffer

The bug can be fixed in "/etc/default/grub" by adding

GRUB_GFXPAYLOAD_LINUX=text

However, this is a local workaround. The blueprint refers to the file "/boot/grub/gfxblacklist" which is generated by a script in the package "grub-gfxpayload-lists". The file contains PCI IDs of video devices that GRUB should not leave in graphics mode. These are declared in "/usr/share/grub-gfxpayload-lists/blacklist/"

The attached patch adds a new file "20_intel" to the blacklisted devices in the package.

If adding it manually to a system, place it in the "/usr/share/grub-gfxpayload-lists/blacklist/" directory.

To add the new device to "/boot/grub/gfxblacklist.txt" run:

sudo update-grub-gfxpayload