Grub2BootFramebuffer

Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2010-04-08 12:43:47
Size: 3581
Editor: halo
Comment:
Revision 6 as of 2010-07-08 13:12:48
Size: 5374
Editor: 82-69-40-219
Comment: pm-utils doesn't need fixing
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from FoundationsTeam/Grub2Efifb
Line 3: Line 4:
 * '''Launchpad Entry''': UbuntuSpec:foundations-maverick-grub2-efifb  * '''Launchpad Entry''': UbuntuSpec:foundations-m-grub2-boot-framebuffer
Line 5: Line 6:
 * '''Contributors''': ColinWatson, ScottJamesRemnant  * '''Contributors''': ColinWatson, ScottJamesRemnant, MatthewGarrett, ColinKing, MichaelFrey, ...
Line 10: Line 11:
GRUB2 supports programming a VBE mode in the boot loader and telling the kernel about it, causing the kernel to use efifb. With Linux 2.6.34, 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. 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.
Line 14: Line 15:
This section should include a paragraph describing the end-user impact of this change. It is meant to be included in the release notes of the first release in which it is implemented. (Not all of these will actually be included in the release notes, at the release manager's discretion; but writing them is a useful exercise.)

It is mandatory.
Ubuntu now enters graphical mode in the boot loader, and remains in graphical mode for the duration of the startup process.
Line 20: Line 19:
We want a smooth boot experience. In the process, we want to not break all the fiddly stuff - non-KMS, suspend/resume, etc. 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.
Line 22: Line 21:
== User stories == 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.
Line 24: Line 23:
== Assumptions == In the process of all of this, we want to not break all the fiddly stuff - non-KMS, suspend/resume, etc.
Line 28: Line 27:
You can have subsections that better describe specific parts of the issue. === Kernel ===
Line 30: Line 29:
== Implementation == 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.
Line 32: Line 31:
This section should describe a plan of action (the "how") to implement the changes discussed. Could include subsections like: fbcon needs to be built-in on all architectures (already done on ports). vesafb needs to be built-in on x86.
Line 34: Line 33:
=== UI Changes === 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.)
Line 36: Line 35:
Should cover changes required to the UI, or specific UI that is required to implement this === GRUB ===
Line 38: Line 37:
=== Code Changes === 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.
Line 40: Line 39:
Code changes should include an overview of what needs to change, and in some cases even the specific details. 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.
Line 42: Line 41:
=== Migration === 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.
Line 44: Line 43:
Include:
 * data migration, if any
 * redirects from old URLs to new ones, if any
 * how users will be pointed to the new way of doing things, if necessary.
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 ===

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

=== Suspend/resume ===

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

=== X ===

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.
Line 55: Line 69:
== Unresolved issues ==

This should highlight any issues that should be addressed in further specifications, and not problems with the specification itself; since any specification with problems cannot be approved.

== BoF agenda and discussion ==

Use this section to take notes during the BoF; if you keep it in the approved spec, use it for summarising what was discussed and note any options that were rejected.

== Notes from pre-BoF ==

 * Linux 2.6.34, plus https://patchwork.kernel.org/patch/19287/ or equivalent to do fbcon handoff
 * Change GRUB packaging to use efifb by default if we have a new enough kernel
 * Default video mode will be a VBE mode, unless Vladimir manages to import KMS drivers into GRUB as suggested
 * Plymouth needs to cope with framebuffer mode change (probably just a bug fix, Scott thinks Plymouth's design is already sufficient)
 * Quirk pm-utils to do VBE state/mode save/restore when using efifb (and vesafb)
 * Suitable GRUB background image, probably reusing Plymouth's logo file (scaling/centring issues?), and set appropriate foreground/background colours
 * Make sure GRUB shows background image even if not showing the menu
 * Build fbcon into the kernel on all architectures (already done on ports)

Summary

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.

Release Note

Ubuntu now enters graphical mode in the boot loader, and remains in graphical mode for the duration of the startup process.

Rationale

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.

Design

Kernel

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

GRUB

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

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

Suspend/resume

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

X

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.

Test/Demo Plan

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.


CategorySpec

FoundationsTeam/Grub2BootFramebuffer (last edited 2010-12-15 15:12:08 by 82-69-40-219)