Launchpad Entry: appselection-foundations-n-grub2-boot-framebuffer
Packages affected: grub2, plymouth, pm-utils, linux
GRUB2 supports programming a VBE mode in the boot loader and telling the kernel about it, causing the kernel to use a framebuffer at boot. With Linux 2.6.34, vesafb/efifb can hand over smoothly to a KMS driver, allowing us to assemble all of this into something very close to a flicker-free boot splash process.
Ubuntu now enters graphical mode in the boot loader, and remains in graphical mode for the duration of the startup process.
We would like to get to the point where users can be in graphical mode throughout the entire boot, particularly to cover the several seconds (sometimes more) of blank screen before Plymouth.
We currently come up in text mode, but have to switch to graphics before we can go to splash. A high-resolution console is preferable as early as possible as we can then do it only once, and therefore do *less*. If we always had a framebuffer, we would have to do this exactly once, so we could always do graphics: win. We would also have better fallback options available: X could fall back to the framebuffer. It should be noted that almost all other architectures are framebuffer from the start, so this would bring x86 into line with them.
In the process of all of this, we want to not break all the fiddly stuff - non-KMS, suspend/resume, etc.
Linux 2.6.34 deals with much of this. We also need something like https://patchwork.kernel.org/patch/19287/ to get fbcon to preserve the initial framebuffer contents on startup.
fbcon needs to be built-in on all architectures (already done on ports). vesafb needs to be built-in on x86.
Note that we will likely require a mode change to a non-VESA native mode at some point in the proceedings, at least on KMS, so we will still have the same number of mode switches. For the time being, this is inevitable and probably worth it: almost any plausible graphical mode is better than a black screen with a blinking cursor. (If OEMs can arrange for appropriate VBE modes to be available, this will very likely mitigate this problem.)
We will fix GRUB to program vesafb rather than efifb in the boot parameters structure on x86, following guidance from kernel developers. We will then change GRUB's packaging to use vesafb by default provided that we have a new enough kernel.
The default video mode will be a VBE mode, which GRUB can handle natively. There has been some suggestion of importing KMS drivers into GRUB; while this would be an interesting future enhancement, for now we should probably keep things reasonably simple.
We will reuse Plymouth's logo file as a GRUB background image, being aware of scaling/centring issues (it may be possible to do this on the fly in GRUB), and set appropriate foreground/background colours. The background image will be shown even if we aren't showing the menu.
MichaelFrey believes that GRUB fails to set VESA modes on some hardware. We will need to test early, and hunt-and-destroy such problems.
Once everything is in place, it should be feasible to once again pause briefly to allow access to GRUB.
Plymouth needs to cope with the framebuffer mode changing during boot, as it currently produces garbled output. This is probably just a bug fix (Scott thinks Plymouth's design is already sufficient).
We will quirk pm-utils to do VBE state/mode save/restore when using efifb or vesafb. We will be relying on quirking here and VT switching to ensure that suspend/resume will restore the video. This is an area where bugs are likely and early testing will be beneficial.
(Update: This seems to have already been done upstream, or perhaps we misunderstood the code when we read through it initially. pm-utils enables VBE state/mode save/restore if it doesn't know any better, and only turns it off if explicitly instructed or for various special cases, which do not include efifb or vesafb.)
The current failsafe X system can be simplified in light of this specification, since fbdev will always be available. We should ensure that a visual indication is displayed in the event that X falls back from some other driver to fbdev.
Modern NVIDIA cards can set modes, but can't restore them after resume. Fortunately, these cards are supported by both nouveau and nvidia-glx, but this means that this wouldn't work with the nv driver. Further feedback is welcome.
It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during testing, and to show off after release. Please add an entry to http://testcases.qa.ubuntu.com/Coverage/NewFeatures for tracking test coverage.
This need not be added or completed until the specification is nearing beta.